feat(underglow): Convert HSB changes to absolute.

* Public type for HSB led color.
* New API for calculating "next" HSB based on current
  state.
* Update behavior to convert the increment/decrement
  commands to absolute command as well.
This commit is contained in:
Pete Johanson
2021-02-02 14:50:02 -05:00
parent e6f168d6df
commit 2af794eed3
4 changed files with 132 additions and 87 deletions

View File

@@ -32,5 +32,6 @@
#define RGB_SPD RGB_SPD_CMD 0
#define RGB_EFF RGB_EFF_CMD 0
#define RGB_EFR RGB_EFR_CMD 0
#define RGB_COLOR_HSB(h, s, v) RGB_COLOR_HSB_CMD(((h) << 16) + ((s) << 8) + (v))
#define RGB_COLOR_HSB_VAL(h, s, v) (((h) << 16) + ((s) << 8) + (v))
#define RGB_COLOR_HSB(h, s, v) RGB_COLOR_HSB_CMD##(RGB_COLOR_HSB_VAL(h, s, v))
#define RGB_COLOR_HSV RGB_COLOR_HSB