mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-13 22:29:26 +03:00
Fix colour component combination. Render text as valid #xxxxxx too.
svn path=/trunk/netsurf/; revision=11737
This commit is contained in:
parent
675a07083a
commit
f8c5eeb70a
@ -529,13 +529,13 @@ int snoptionf(char *string, size_t size, unsigned int option, const char *fmt)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case OPTION_COLOUR:
|
case OPTION_COLOUR:
|
||||||
rgbcolour = ((0x000000FF | *((colour *)
|
rgbcolour = ((0x000000FF & *((colour *)
|
||||||
option_entry->p)) << 16) &
|
option_entry->p)) << 16) |
|
||||||
((0x0000FF00 | *((colour *)
|
((0x0000FF00 & *((colour *)
|
||||||
option_entry->p)) << 0) &
|
option_entry->p)) << 0) |
|
||||||
((0x00FF0000 | *((colour *)
|
((0x00FF0000 & *((colour *)
|
||||||
option_entry->p)) >> 16);
|
option_entry->p)) >> 16);
|
||||||
slen += snprintf(string + slen, size - slen, "<span style=\"background-color: #%06x; color: #%06x;\">%x</span>", rgbcolour, (~rgbcolour) & 0xffffff, rgbcolour);
|
slen += snprintf(string + slen, size - slen, "<span style=\"background-color: #%06x; color: #%06x;\">#%06x</span>", rgbcolour, (~rgbcolour) & 0xffffff, rgbcolour);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPTION_STRING:
|
case OPTION_STRING:
|
||||||
|
Loading…
Reference in New Issue
Block a user