diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2020-02-24 18:21:00 +0000 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2020-02-24 18:22:03 +0000 |
commit | 1e6b0f1d76198cf1770d92684bd70ed35d981d0d (patch) | |
tree | f9ab1233c95f9c39cc4eca9d416f641478f55a4c /include | |
parent | 4c256408c5b21d20bf703571ba106f7bb6101ada (diff) | |
download | netsurf-1e6b0f1d76198cf1770d92684bd70ed35d981d0d.tar.gz netsurf-1e6b0f1d76198cf1770d92684bd70ed35d981d0d.tar.bz2 |
Plot style: Add helper to swap red and blue channels.
Diffstat (limited to 'include')
-rw-r--r-- | include/netsurf/plot_style.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/netsurf/plot_style.h b/include/netsurf/plot_style.h index bc8604114..fee7a1078 100644 --- a/include/netsurf/plot_style.h +++ b/include/netsurf/plot_style.h @@ -188,6 +188,12 @@ typedef struct plot_font_style { #define blue_from_colour(c) \ ((c >> 16) & 0xff) +/* Swap red and blue channels in a colour */ +#define colour_rb_swap(c) \ + (((0x000000ff & c) << 16) | \ + ((0x0000ff00 & c) ) | \ + ((0x00ff0000 & c) >> 16)) + /** Colour components */ enum plot_colour_component { PLOT_COLOUR_COMPONENT_RED, |