refactor: modular RGB effect registration API

Replace hardcoded effect enum/switch-case with STRUCT_SECTION_ITERABLE
registration. Effects register via ZMK_RGB_EFFECT_DEFINE macro.

Core API (rgb_effect.h):
- zmk_rgb_effect_ctx passed to render callbacks
- zmk_rgb_request_refresh() for static effects
- ZMK_RGB_EFFECT_STATIC flag skips animation timer
- on_select/on_deselect lifecycle hooks
- zmk_rgb_hsb_to_rgb/scale helpers now public

Built-in effects (solid/breathe/spectrum/swirl) use same API.
Per-key layer RGB, behaviors, DTS bindings extracted to external
zmk-rgb-effects module.
This commit is contained in:
afiqzudinhadi 2026-07-01 14:29:24 +08:00
parent d94d1597c1
commit 8f3c4d3929
16 changed files with 209 additions and 656 deletions

View file

@ -1,12 +0,0 @@
# Copyright (c) 2024, The ZMK Contributors
# SPDX-License-Identifier: MIT
description: Set underglow color based on battery level
compatible: "zmk,behavior-underglow-battery"
include: two_param.yaml
properties:
threshold:
type: int

View file

@ -1,8 +0,0 @@
# Copyright (c) 2024, The ZMK Contributors
# SPDX-License-Identifier: MIT
description: Set underglow to specified color
compatible: "zmk,behavior-underglow-color"
include: one_param.yaml

View file

@ -1,13 +0,0 @@
# Copyright (c) 2024, The ZMK Contributors
# SPDX-License-Identifier: MIT
description: Set underglow for num lock indicator
compatible: "zmk,behavior-underglow-indicators"
include: two_param.yaml
properties:
indicator:
type: int
default: 0

View file

@ -1,24 +0,0 @@
description: |
Allows defining a rgbmap composed of multiple layers
compatible: "zmk,underglow-layer"
properties:
pixel-lookup:
type: array
required: true
child-binding:
description: "A layer to be used in a rgbmap"
properties:
bindings:
type: phandle-array
required: true
layer-id:
type: int
required: true
fade-delay:
type: int
required: false
default: -1