Lighting is often used for either aesthetics or for the practical purposes of lighting up keys in the dark. Currently ZMK supports RGB underglow, which can be changed and configured using its behavior.
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:
|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|
The "RGB underglow" behavior completes an RGB action given on press.
- Parameter #1: The RGB action define, e.g.
- Parameter #2: Only applies to
RGB_COLOR_HSBand is the HSB values of the color to set within parenthesis and separated by a common (see below for an example)
When specifying HSB values you'll need to use
RGB_COLOR_HSB(h, s, b) in your keymap file. See below for an example.
- Hue values can not exceed 360 (degrees)
- Saturation values can not exceed 100 (percent)
- Brightness values can not exceed 100 (percent)
Toggle underglow on/off&rgb_ug RGB_TOG
Set a specific HSB color (green)&rgb_ug RGB_COLOR_HSB(128,100,100)