Merge with git+ssh://pasky.or.cz/srv/git/elinks.git
[elinks.git] / src / util / color.h
blob7fb6c46e94389be33d2fc93575a98ab2ba41a777
1 #ifndef EL__UTIL_COLOR_H
2 #define EL__UTIL_COLOR_H
4 typedef uint32_t color_T;
6 struct color_pair {
7 color_T background;
8 color_T foreground;
9 };
11 #define INIT_COLOR_PAIR(bg, fg) { bg, fg }
13 /* Decode the color string. */
14 /* The color string can either contain '#FF0044' style declarations or
15 * color names. */
16 int decode_color(unsigned char *str, int slen, color_T *color);
18 /* Returns a string containing the color info. If no ``English'' name can be
19 * found the hex color (#rrggbb) is returned in the given buffer. */
20 const unsigned char *get_color_string(color_T color, unsigned char hexcolor[8]);
22 /* Translate rgb color to string in #rrggbb format. str should be a pointer to
23 * a 8 bytes memory space. */
24 void color_to_string(color_T color, unsigned char str[8]);
26 /* Fastfind lookup management. */
27 void init_colors_lookup(void);
28 void free_colors_lookup(void);
30 #endif