1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-02 02:15:28 +00:00

Move code from get_color() to new extract_color().

This commit is contained in:
Laurent MONIN 2007-10-15 12:17:08 +02:00
parent 11dea66ff1
commit b709061864

View File

@ -50,17 +50,13 @@
/* TODO: This needs rewrite. Yes, no kidding. */ /* TODO: This needs rewrite. Yes, no kidding. */
static int
int extract_color(struct html_context *html_context, unsigned char *a,
get_color(struct html_context *html_context, unsigned char *a, unsigned char *c, color_T *rgb)
unsigned char *c, color_T *rgb)
{ {
unsigned char *at; unsigned char *at;
int r; int r;
if (!use_document_fg_colors(html_context->options))
return -1;
at = get_attr_val(a, c, html_context->doc_cp); at = get_attr_val(a, c, html_context->doc_cp);
if (!at) return -1; if (!at) return -1;
@ -70,6 +66,16 @@ get_color(struct html_context *html_context, unsigned char *a,
return r; return r;
} }
int
get_color(struct html_context *html_context, unsigned char *a,
unsigned char *c, color_T *rgb)
{
if (!use_document_fg_colors(html_context->options))
return -1;
return extract_color(html_context, a, c, rgb);
}
int int
get_bgcolor(struct html_context *html_context, unsigned char *a, color_T *rgb) get_bgcolor(struct html_context *html_context, unsigned char *a, color_T *rgb)
{ {