Skip to content
Snippets Groups Projects
Verified Commit 03762590 authored by dos's avatar dos
Browse files

st3m: leds: Scale the slew rate for each channel separately

The reason why this is needed is pretty easy to observe when
taking a color like (1.0, 0.75, 0.0), which appears yellow,
and transitioning it to (0.0, 0.0, 0.0). Without this,
all the channel values get reduced at constant rate, meaning
that the green channel will reach zero much earlier than
the red one, so in the middle of transition the yellow color
will turn into red.

To prevent that and preserve the hue, desaturate only the channel
with the greatest difference from target at full rate and scale
the rest in relation to that one. This way the transition still
takes the exact same time, but doesn't go through unexpected
color hues during it.
parent 43798847
No related branches found
No related tags found
No related merge requests found
Pipeline #8994 passed