api

color_utils.ch

Declarations in color_utils.ch

3 declarationscss_parser

Declarations

Public only
hex_digit_to_int#
function
func hex_digit_to_int(c : char) : int
parse_css_hex_color#
function
func parse_css_hex_color(str : *char, len : size_t, outColor : *uint32_t) : bool
Parses a CSS hex color string into a 32-bit unsigned integer. REQUIREMENT: str must not contain '#' symbol at the zero index REQUIREMENT: str must of 3, 4, 6 or 8 in length Acceptable formats: 3-digit (#RGB), 4-digit (#RGBA), 6-digit (#RRGGBB) or 8-digit (#RRGGBBAA). The resulting 32-bit color is stored in 0xRRGGBBAA format, where the alpha channel defaults to 0xFF if not provided. Returns true on success, or false if the input is invalid.