mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
Move code from get_color() to new extract_color().
This commit is contained in:
parent
11dea66ff1
commit
b709061864
@ -50,17 +50,13 @@
|
||||
|
||||
/* TODO: This needs rewrite. Yes, no kidding. */
|
||||
|
||||
|
||||
int
|
||||
get_color(struct html_context *html_context, unsigned char *a,
|
||||
unsigned char *c, color_T *rgb)
|
||||
static int
|
||||
extract_color(struct html_context *html_context, unsigned char *a,
|
||||
unsigned char *c, color_T *rgb)
|
||||
{
|
||||
unsigned char *at;
|
||||
int r;
|
||||
|
||||
if (!use_document_fg_colors(html_context->options))
|
||||
return -1;
|
||||
|
||||
at = get_attr_val(a, c, html_context->doc_cp);
|
||||
if (!at) return -1;
|
||||
|
||||
@ -70,6 +66,16 @@ get_color(struct html_context *html_context, unsigned char *a,
|
||||
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
|
||||
get_bgcolor(struct html_context *html_context, unsigned char *a, color_T *rgb)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user