38 prgbcolor =
fc_calloc(1,
sizeof(*prgbcolor));
42 prgbcolor->
color = NULL;
68 return (c1->
r == c2->
r && c1->
g == c2->
g && c1->
b == c2->
b);
80 if (prgbcolor->
color) {
100 va_start(args, path);
122 const struct rgbcolor *prgbcolor,
char *path, ...)
130 va_start(args, path);
154 (prgbcolor->
r * 256 + prgbcolor->
g) * 256 + prgbcolor->
b);
174 if (strlen(hex) != 6) {
179 if (!sscanf(hex2,
"%x", &rgb)) {
184 g = (rgb -
r * 256 * 256) / 256;
206 return (prgbcolor->
r*299 + prgbcolor->
g*587 + prgbcolor->
b*114) / 1000;
const struct functions * fc_funcs
#define fc_assert_ret(condition)
#define fc_assert_ret_val(condition, val)
#define fc_calloc(n, esz)
bool secfile_lookup_int(const struct section_file *secfile, int *ival, const char *path,...)
#define secfile_insert_int(secfile, value, path,...)
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 rgbcolor_load(struct section_file *file, struct rgbcolor **prgbcolor, char *path,...)
struct rgbcolor * rgbcolor_copy(const struct rgbcolor *prgbcolor)
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)
void rgbcolor_save(struct section_file *file, const struct rgbcolor *prgbcolor, char *path,...)
#define rgbcolor_check(_str, _r, _g, _b)
void(* gui_color_free)(struct color *pcolor)
int fc_snprintf(char *str, size_t n, const char *format,...)
int fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)