summaryrefslogtreecommitdiff
path: root/quantum/color.h
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2019-06-05 17:11:34 -0700
committerFlorian Didron <fdidron@users.noreply.github.com>2019-06-06 09:11:34 +0900
commit9b248baf4399a6cbe3688a437cdbec7b267f8631 (patch)
treeee462740daa5654f35fc01d4ea6b8b36559e1b95 /quantum/color.h
parentf781b36aaa88f8748d9db62f9980d8bb9bd35e9b (diff)
Moving rgb typedefs into a single location (#5978) (#69)
Because someone named the define poorly Using full relative path as handwired/promethium has a color.h file
Diffstat (limited to 'quantum/color.h')
-rw-r--r--quantum/color.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/quantum/color.h b/quantum/color.h
index 9d51d45adb..22bb083519 100644
--- a/quantum/color.h
+++ b/quantum/color.h
@@ -32,12 +32,30 @@
#pragma pack( push, 1 )
#endif
+#ifdef RGBW
+ #define LED_TYPE cRGBW
+#else
+ #define LED_TYPE RGB
+#endif
+
+// WS2812 specific layout
typedef struct PACKED
{
+ uint8_t g;
uint8_t r;
+ uint8_t b;
+} cRGB;
+
+typedef cRGB RGB;
+
+// WS2812 specific layout
+typedef struct PACKED
+{
uint8_t g;
+ uint8_t r;
uint8_t b;
-} RGB;
+ uint8_t w;
+} cRGBW;
typedef struct PACKED
{
@@ -50,6 +68,6 @@ typedef struct PACKED
#pragma pack( pop )
#endif
-RGB hsv_to_rgb( HSV hsv );
+RGB hsv_to_rgb(HSV hsv);
#endif // COLOR_H