39#define SPECLIST_TAG rgbcolor
40#define SPECLIST_TYPE struct rgbcolor
43#define rgbcolor_list_iterate(rgbcolorlist, prgbcolor) \
44 TYPED_LIST_ITERATE(struct rgbcolor, rgbcolorlist, prgbcolor)
45#define rgbcolor_list_iterate_end LIST_ITERATE_END
49#define CHECK_RGBCOLOR(_str, _c, _colorname) \
51 int _color_save = _c; \
53 _c = CLIP(0, _c, 255); \
54 if (_c != _color_save) { \
55 log_error("Invalid value for '%s' in color definition '%s' (%d). " \
56 "Setting it to '%d'.", _colorname, _str, _color_save, _c); \
59#define rgbcolor_check(_str, _r, _g, _b) \
61 CHECK_RGBCOLOR(_str, _r, "red"); \
62 CHECK_RGBCOLOR(_str, _g, "green"); \
63 CHECK_RGBCOLOR(_str, _b, "blue"); \
bool rgbcolor_load(struct section_file *file, struct rgbcolor **prgbcolor, char *path,...) fc__attribute((__format__(__printf__
bool rgbcolor_from_hex(struct rgbcolor **prgbcolor, const char *hex)
void rgbcolor_destroy(struct rgbcolor *prgbcolor)
bool rgbcolors_are_equal(const struct rgbcolor *c1, const struct rgbcolor *c2)
bool void rgbcolor_save(struct section_file *file, const struct rgbcolor *prgbcolor, char *path,...) fc__attribute((__format__(__printf__
struct rgbcolor * rgbcolor_copy(const struct rgbcolor *prgbcolor)
bool void bool rgbcolor_to_hex(const struct rgbcolor *prgbcolor, char *hex, size_t hex_len)
struct rgbcolor * rgbcolor_new(int r, int g, int b)
int rgbcolor_brightness_score(struct rgbcolor *prgbcolor)