cocos_hex_to_rgba
Convert hex color codes to RGBA integer values for Cocos Creator game development, eliminating manual translation errors when using CSS or design tool colors.
Instructions
Convert #rrggbb / #rgb / #rrggbbaa to RGBA ints.
Returns {r, g, b, a} suitable for any tool that takes
color_r/color_g/color_b/color_a params.
Lets the caller paste CSS / design-tool hex codes without
hand-translating to int quadruples (a common source of off-by-one
color bugs).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hex_color | Yes | ||
| alpha | No |