19#define COLOR_MAKE_RGB(rv, gv, bv) {.b = (bv), .g = (gv), .r = (rv), .a = 255}
24#define COLOR_MAKE_RGBA(rv, gv, bv, av) {.b = (bv), .g = (gv), .r = (rv), .a = (av)}
29#define COLOR_MAKE_HEX(hex) \
30 {.b = (hex) & 0xFF, .g = ((hex) >> 8) & 0xFF, .r = ((hex) >> 16) & 0xFF, .a = 255}
35#define COLOR_MAKE_HEXA(hexa) \
36 {.a = (hexa) & 0xFF, \
37 .b = ((hexa) >> 8) & 0xFF, \
38 .g = ((hexa) >> 16) & 0xFF, \
39 .r = ((hexa) >> 24) & 0xFF}
Color color_hexa_to_rgb(uint32_t hexa)
Convert a HEX 0xRRGGBBAA representation to an RGB color.
Definition color.c:83
Color color_hex_to_rgb(uint32_t hex)
Convert a HEX 0xRRGGBB representation to an RGB color.
Definition color.c:70
bool color_parse_hex_string(const char *hex, Color *color_out)
Convert a HEX "#RRGGBB" representation to an RGB color.
Definition color.c:94
bool color_parse_hexa_string(const char *hexa, Color *color_out)
Convert a HEX "#RRGGBBAA" representation to an RGB color.
Definition color.c:104
void color_buf_l8_to_l4(void *dst, const void *src, size_t size)
Convert an L8-encoded color data into L4.
Definition color.c:122
uint8_t color_rgb_to_l8(Color color)
Convert an RGB color to an L8 luminance value.
Definition color.c:114
Color color_hsv_to_rgb(ColorHsv hsv)
Convert HSV color to RGB color.
Definition color.c:9
HSV color structure.
Definition color.h:50
uint8_t a
Alpha component.
Definition color.h:54
uint8_t s
Saturation component.
Definition color.h:52
uint8_t v
Value component.
Definition color.h:53
uint8_t h
Hue component.
Definition color.h:51
RGB color structure.
Definition color.h:42
uint8_t a
Alpha component.
Definition color.h:46
uint8_t g
Green component.
Definition color.h:44
uint8_t b
Blue component.
Definition color.h:43
uint8_t r
Red component.
Definition color.h:45