summaryrefslogtreecommitdiff
path: root/css/utils.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-12-04 21:52:26 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-12-04 21:52:26 +0000
commit73ace49c5a12b556e873252032d3117152d90a3f (patch)
treea87733340cbb3a22888a8ea2e15f2c5bbb9f8123 /css/utils.h
parent1a1bf3d2f0fe429715f7523ccbd0574889705990 (diff)
downloadnetsurf-73ace49c5a12b556e873252032d3117152d90a3f.tar.gz
netsurf-73ace49c5a12b556e873252032d3117152d90a3f.tar.bz2
Fix colours
svn path=/trunk/netsurf/; revision=10989
Diffstat (limited to 'css/utils.h')
-rw-r--r--css/utils.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/css/utils.h b/css/utils.h
index 71da8a41a..11403b5da 100644
--- a/css/utils.h
+++ b/css/utils.h
@@ -28,14 +28,16 @@ extern css_fixed nscss_screen_dpi;
/**
* Convert a CSS color to a NetSurf colour primitive
*
+ * ARGB -> (1-A)BGR
+ *
* \param color The CSS color to convert
* \return Corresponding NetSurf colour primitive
*/
#define nscss_color_to_ns(color) \
- (((color) & 0xff000000) >> 24) | \
- (((color) & 0xff0000) >> 8) | \
- (((color) & 0xff00) << 8) | \
- (((color) & 0xff) << 24)
+ (0xff000000 - ((color) & 0xff000000)) | \
+ (((color) & 0xff0000) >> 16) | \
+ ((color) & 0xff00) | \
+ (((color) & 0xff) << 16)
css_fixed nscss_len2pt(css_fixed length, css_unit unit);
css_fixed nscss_len2px(css_fixed length, css_unit unit,