Skip to content

Commit

Permalink
feat(docs): Document and define different RGB effects
Browse files Browse the repository at this point in the history
Co-Authored-By: Cem Aksoylar <caksoylar@users.noreply.github.com>
  • Loading branch information
ReFil and caksoylar committed Mar 22, 2024
1 parent cc22287 commit 829b75b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
7 changes: 6 additions & 1 deletion app/include/dt-bindings/zmk/rgb.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@
#define RGB_MEFS RGB_MEFS_CMD
#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
#define RGB_COLOR_HSV RGB_COLOR_HSB

#define RGB_EFF_SOLID 0
#define RGB_EFF_BREATHE 1
#define RGB_EFF_SPECTRUM 2
#define RGB_EFF_SWIRL 3
11 changes: 9 additions & 2 deletions docs/docs/behaviors/underglow.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ However the settings will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNC

:::note Effect Selection

When using the `RGB_EFS` or `RGB_MEFS` definitions you must also include a number as an argument in the keymap corresponding to the effect you want to select e.g. `RGB_EFS 0`
When using the `RGB_EFS` or `RGB_MEFS` definitions you must also include a parameter corresponding to the effect you want to select, e.g. `&rgb_ug RGB_EFS RGB_EFF_SOLID`. There are currently 4 RGB effects, defined in [`dt-bindings/zmk/rgb.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/rgb.h):

| Value | Effect |
| ------------------ | ----------------------------------------- |
| `RGB_EFF_SOLID` | Solid color (set by HSB) |
| `RGB_EFF_BREATHE` | Breathe a solid color |
| `RGB_EFF_SPECTRUM` | Cycle all LEDs through the color spectrum |
| `RGB_EFF_SWIRL` | Swirl a rainbow around the LEDs |

:::

Expand All @@ -92,7 +99,7 @@ If the `RGB_MEFS` key is held down for longer than [`CONFIG_ZMK_SETTINGS_SAVE_DE
1. Select a specific RGB effect (Swirl)

```dts
&rgb_ug RGB_EFS 3
&rgb_ug RGB_EFS RGB_EFF_SWIRL
```

## Split Keyboards
Expand Down

0 comments on commit 829b75b

Please sign in to comment.