Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smooth out hue transitions. #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

bjc
Copy link

@bjc bjc commented Aug 14, 2018

In spite of the API taking uint16_t for the HSV parameters for hsv()
(which appears to be in order to retain compatibility with existing
plugins), the expected values are actually in the 0 ... 255 range.

Update calls to make sure values passed are within that range. This
did mean flattening out the value portion from 128 ... 255 to a flat
255, which isn't ideal, but I didn't have a better idea off the top of
my head.

The effect of this change is that there are no longer oddly flashing
colors while cycling through the ripple effect.

In addition I've added a starting_hue constant (set to a shade of
purple I like, but easily changed), and a compile time #ifdef that
controls whether or not to cycle hues, called
CONSTANT_HUE. Personally, I prefer the CONSTANT_HUE effect, which is
less blingy, but IMHO shows the ripple effect better. This should
probably be turned into a run time switch.

In spite of the API taking uint16_t for the HSV parameters for hsv()
(which appears to be in order to retain compatibility with existing
plugins), the expected values are actually in the 0 ... 255 range.

Update calls to make sure values passed are within that range. This
did mean flattening out the value portion from 128 ... 255 to a flat
255, which isn't ideal, but I didn't have a better idea off the top of
my head.

The effect of this change is that there are no longer oddly flashing
colors while cycling through the ripple effect.

In addition I've added a starting_hue constant (set to a shade of
purple I like, but easily changed), and a compile time #ifdef that
controls whether or not to cycle hues, called
CONSTANT_HUE. Personally, I prefer the CONSTANT_HUE effect, which is
less blingy, but IMHO shows the ripple effect better. This should
probably be turned into a run time switch.
obra pushed a commit to keyboardio/Kaleidoscope that referenced this pull request Dec 20, 2018
Based largely on ToyKeeper/Kaleidoscope-LED-Wavepool#8, this smooths out the hue
transitions, so that the ripple is a nice rainbow, without oddly flashing colors
while cycling through the effect.

Thanks @bjc for the change!

Signed-off-by: Gergely Nagy <[email protected]>
obra pushed a commit to keyboardio/Kaleidoscope that referenced this pull request Dec 20, 2018
While the rainbow colors are great, some may want to restrict the colors to a
single hue. For this purpose, the `ripple_hue` property was introduced. It
defaults to `Wavepool.rainbow_hue` (a special value that tells the plugin to use
multiple hues).

Inspired by @bjc's ToyKeeper/Kaleidoscope-LED-Wavepool#8.

Signed-off-by: Gergely Nagy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant