ELinks 0.18.0
|
Color parser. More...
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "elinks.h"
#include "util/color.h"
#include "util/conv.h"
#include "util/fastfind.h"
#include "util/color_s.inc"
#include "util/color.inc"
Data Structures | |
struct | color_spec |
Functions | |
static void | colors_list_reset (void) |
static struct fastfind_key_value * | colors_list_next (void) |
Returns a pointer to a struct that contains current key and data pointers and increment internal pointer. | |
void | init_colors_lookup (void) |
void | free_colors_lookup (void) |
int | decode_color (const char *str, int slen, color_T *color) |
Decode the color string. | |
const char * | get_color_string (color_T color, char hexcolor[8]) |
Returns a string containing the color info. | |
void | color_to_string (color_T color, char str[8]) |
Translate rgb color to string in #rrggbb format. |
Variables | |
static const struct color_spec | color_specs [] |
static const struct color_spec * | internal_pointer |
static struct fastfind_index | ff_colors_index = INIT_FASTFIND_INDEX("colors_lookup", colors_list_reset, colors_list_next) |
Color parser.
void color_to_string | ( | color_T | color, |
char | str[8] ) |
Translate rgb color to string in #rrggbb format.
str should be a pointer to an 8 bytes memory space.
|
static |
Returns a pointer to a struct that contains current key and data pointers and increment internal pointer.
It returns NULL when key is NULL.
|
static |
int decode_color | ( | const char * | str, |
int | slen, | ||
color_T * | color ) |
Decode the color string.
The color string can either contain '#FF0044' style declarations or color names.
void free_colors_lookup | ( | void | ) |
const char * get_color_string | ( | color_T | color, |
char | hexcolor[8] ) |
Returns a string containing the color info.
If no 'English' name can be found the hex color (#rrggbb) is returned in the given buffer.
void init_colors_lookup | ( | void | ) |
|
static |
|
static |
|
static |