59 return (c1->
r == c2->
r && c1->
g == c2->
g && c1->
b == c2->
b);
79 const char *path, ...)
110 const struct rgbcolor *prgbcolor,
const char *path, ...)
118 va_start(args, path);
143 (prgbcolor->
r * 256 + prgbcolor->
g) * 256 + prgbcolor->
b);
163 if (strlen(hex) != 6) {
168 if (!sscanf(hex2,
"%x", &rgb)) {
173 g = (rgb -
r * 256 * 256) / 256;
195 return (prgbcolor->
r * 299 + prgbcolor->
g * 587 + prgbcolor->
b * 114)
#define fc_assert_ret(condition)
#define fc_assert_ret_val(condition, val)
bool secfile_lookup_int(const struct section_file *secfile, int *ival, const char *path,...)
Lookup a integer value in the secfile.
#define secfile_insert_int(secfile, value, path,...)
bool rgbcolor_from_hex(struct rgbcolor **prgbcolor, const char *hex)
Convert a hex string into a rgb color.
void rgbcolor_destroy(struct rgbcolor *prgbcolor)
Free rgbcolor structure.
bool rgbcolors_are_equal(const struct rgbcolor *c1, const struct rgbcolor *c2)
Test whether two rgbcolor structures represent the exact same color value.
bool rgbcolor_load(struct section_file *file, struct rgbcolor **prgbcolor, const char *path,...)
Lookup an RGB color definition ([colorpath].red, [colorpath].green and [colorpath]....
struct rgbcolor * rgbcolor_new(int r, int g, int b)
Allocate new rgbcolor structure.
void rgbcolor_save(struct section_file *file, const struct rgbcolor *prgbcolor, const char *path,...)
Save an RGB color definition ([colorpath].red, [colorpath].green and [colorpath].blue).
bool rgbcolor_to_hex(const struct rgbcolor *prgbcolor, char *hex, size_t hex_len)
Convert a rgb color to a hex string (like 0xff0000 for red [255, 0, 0]).
int rgbcolor_brightness_score(struct rgbcolor *prgbcolor)
Return a number indicating the perceptual brightness of this color relative to others (larger is brig...
struct rgbcolor * rgbcolor_copy(const struct rgbcolor *prgbcolor)
Allocate new rgbcolor structure and make it copy of one given as input.
#define rgbcolor_check(_str, _r, _g, _b)
int fc_snprintf(char *str, size_t n, const char *format,...)
See also fc_utf8_snprintf_trunc(), fc_utf8_snprintf_rep().
int fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)