summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'desktop')
-rw-r--r--desktop/plot_style.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/desktop/plot_style.h b/desktop/plot_style.h
index 71243a9a9..45813d40d 100644
--- a/desktop/plot_style.h
+++ b/desktop/plot_style.h
@@ -75,9 +75,21 @@
((c0 & 0x00ff00) * ( p)) ) >> 8) & 0x00ff00))
/* get a bitmap pixel (image/bitmap.h) into a plot colour */
-#define pixel_to_colour(b) \
+#define pixel_to_colour(b) \
b[0] | (b[1] << 8) | (b[2] << 16) | (b[3] << 24)
+/* Get the red channel from a colour */
+#define red_from_colour(c) \
+ ((c ) & 0xff)
+
+/* Get the green channel from a colour */
+#define green_from_colour(c) \
+ ((c >> 8) & 0xff)
+
+/* Get the blue channel from a colour */
+#define blue_from_colour(c) \
+ ((c >> 16) & 0xff)
+
/**
* Colour type: XBGR
*/