mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-03-12 01:53:09 +03:00
Plot style: Helper macro to get nearest of black and white.
This commit is contained in:
parent
60f8f0126d
commit
3626a5654e
@ -170,6 +170,11 @@ typedef struct plot_font_style {
|
||||
(((c0 & 0x00ff00) * 151) >> 16) + \
|
||||
(((c0 & 0xff0000) * 28) >> 24))
|
||||
|
||||
/* Choose either black or white, depending on which is nearest to the
|
||||
* percieved lightness of the supplied colour, c0. */
|
||||
#define colour_to_bw_nearest(c0) \
|
||||
((colour_lightness(c0) > (0xff / 2)) ? 0xffffff : 0x000000)
|
||||
|
||||
/* Choose either black or white, depending on which is furthest from the
|
||||
* percieved lightness of the supplied colour, c0. */
|
||||
#define colour_to_bw_furthest(c0) \
|
||||
|
Loading…
x
Reference in New Issue
Block a user