0
0
mirror of https://github.com/rkd77/elinks.git synced 2025-06-30 22:19:29 -04:00
elinks/src/util/color.h
Petr Baudis 0f6d4310ad Initial commit of the HEAD branch of the ELinks CVS repository, as of
Thu Sep 15 15:57:07 CEST 2005. The previous history can be added to this
by grafting.
2005-09-15 15:58:31 +02:00

33 lines
925 B
C

/* $Id: color.h,v 1.11 2005/06/26 23:01:50 zas Exp $ */
#ifndef EL__UTIL_COLOR_H
#define EL__UTIL_COLOR_H
typedef uint32_t color_T;
struct color_pair {
color_T background;
color_T foreground;
};
#define INIT_COLOR_PAIR(bg, fg) { bg, fg }
/* Decode the color string. */
/* The color string can either contain '#FF0044' style declarations or
* color names. */
int decode_color(unsigned char *str, int slen, color_T *color);
/* Returns a string containing the color info. If no ``English'' name can be
* found the hex color (#rrggbb) is returned in the given buffer. */
unsigned char *get_color_string(color_T color, unsigned char hexcolor[8]);
/* Translate rgb color to string in #rrggbb format. str should be a pointer to
* a 8 bytes memory space. */
void color_to_string(color_T color, unsigned char str[]);
/* Fastfind lookup management. */
void init_colors_lookup(void);
void free_colors_lookup(void);
#endif