Skip to content

Sync LED colour with the current theme's primary colour #9

Description

@lepht

The LEDs are configured independently of the UI theme today, so changing a colour palette leaves them on whatever they were set to. They should be able to follow the theme.

What exists

  • LightSettings (api.h) carries color1 / color2 per light, with PLAT_setLedColor() / PLAT_setLedEffect() behind it and LEDS_applyRules() in api.c deciding what's active
  • The LedControl pak (workspace/all/ledcontrol/) is the UI for setting them
  • Theme primary is CFG_getColor(COLOR_MAIN) / THEME_COLOR1_255, and palettes swap it wholesale via CFG_applyPalette()

Proposal

A per-light "follow theme" option that drives color1 (and optionally color2 from the accent) off the theme rather than a stored value.

The hook already exists: NextUISettings has a ColorSet_callback_t onColorSet invoked when colours change. Wiring LED re-application into that gets palette switches and individual colour edits for free, without polling.

Notes

  • MAX_LIGHTS is 0 on platforms without LEDs — has to compile out cleanly
  • Respect the existing muteLeds setting; "follow theme" shouldn't override a mute
  • Theme colours are stored unmapped as 0xRRGGBBAA while some LED paths expect screen-mapped values — check which the LED code wants before assuming
  • Worth deciding whether this applies to the ambient/effect modes or only static colour

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions