This page contains RGB Underglow behaviors supported by ZMK.
RGB Action Defines
RGB actions defines are provided through the
which is added at the top of the keymap file:
This will allow you to reference the actions defined in this header such as
Here is a table describing the action for each define:
|Turns the RGB feature on|
|Turns the RGB feature off|
|Toggles the RGB feature on and off|
|Increases the hue of the RGB feature|
|Decreases the hue of the RGB feature|
|Increases the saturation of the RGB feature|
|Decreases the saturation of the RGB feature|
|Increases the brightness of the RGB feature|
|Decreases the brightness of the RGB feature|
|Increases the speed of the RGB feature effect's animation|
|Decreases the speed of the RGB feature effect's animation|
|Cycles the RGB feature's effect forwards|
|Cycles the RGB feature's effect reverse|
|Sets a specific HSB (HSV) value for the underglow|
- Parameter #1: The RGB action define, e.g.
- Parameter #2: Only applies to
RGB_COLOR_HSBand is the HSB representation of the color to set (see below for an example)
When specifying HSB values you'll need to use
RGB_COLOR_HSB(h, s, b) in your keymap file.
- Hue values can not exceed 360 (degrees)
- Saturation values can not exceed 100 (percent)
- Brightness values can not exceed 100 (percent)
The RGB settings that are changed via the
&rgb_ug behavior will be saved to flash storage and hence persist across restarts and firmware flashes.
They will also override the start values set by
However the settings will only be saved after
CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE milliseconds in order to reduce potential wear on the flash memory.
Toggle underglow on/off
Set a specific HSB color (green)
RGB underglow behaviors are global: This means that when triggered, they affect both the central and peripheral side of split keyboards.