add hue names header for convenience - #25
Conversation
|
Sorry for the delay in my reply. I like the idea here. Would you consider using the ~standard FastLED hue color list? https://github.com/FastLED/FastLED/wiki/Pixel-reference (Search for HUE_) Their color list is Red (0..) "HUE_RED" (And really, ORANGE is a little more common than RED_YELLOW as a color ;) |
|
Hello. I agree to the part about ORANGE (obvlously I was being a little unimaginative there) and I have no problem with using other better names. But there may a problem with using the hue values which you have copy-pasted, because they refer to the rainbow HSV colour model provided by FastLED which adjusts for a visually-expected broader yellow band. Further down on that page are the named values for the pure mathematical spectrum model and they correspond to the values I have given (simply because they divide 0–256 into 12 parts). [Well it seems I instead divided 255 into 12 parts so a couple of the values are off by 1 due to rounding but I'll fix that presently.] The current LEDControl implementation doesn't use the FastLED code for HSV-to-RGB conversion, but instead code from some other webpage (which doesn't seem to be available now BTW) which follows the pure mathematical spectrum model as does most simple code on the web. (To use the rainbow model might be desirable, but that's for another day.) See also what the FastLED source says about the differences between the two models. Certainly currently the HSV code doesn't attempt to maintain a uniform brightness and you can observe that the basic Rainbow effect becomes brighter whenever it goes through the CMY colours compared to the plain RGB where only one LED component will be working. Thus I am OK with adding some more readable aliases for the intervening hues but would like to retain the prosaic names as well since they highlight the fact that they bisect the two major hues, and also am not sure these intervening hues all have other more readable names. (FastLED specifies HTML-style names for individual RGB colours but not for other hues AFAICS.) |
|
Something like the Material Design palette has a more comprehensive set of hue names (suffixed with 100, 200 etc), but I rather would just like to give a simple list as we're not doing a whole UI here… |
|
For naming, I think we should be aiming at something simple, like For values, we should be using hue values that are correct for our implementation, not necessarily the ones from FastLED. So the values in the PR are good, the names less so. I realize this has been sitting here for more than a month now without any feedback since @obra's, so if you're not feeling up to it, I can change the names and merge it after. In either case, thank you for both the PR, and the patience! |
|
Hi @algernon and sorry for the delay. Can you please specify which names exactly you would like changed and I'll do the changes and submit? |
|
No worries! I'll try to give you a list later today (I'm knee-deep in something else at the moment) |
|
Hi @algernon I'm cleaning up my old forks of the separate plugin repos. Pl advise what to do with this. |
|
I'd go with the following names & values:
Between 85 and 107, I don't see much difference on the keyboard, so I skipped 107. About 149, I'm torn... it might make for a nice |
|
FWIW, I used this little plugin to test hue colors on the keyboard: class HueTest_ : public kaleidoscope::Plugin {
public:
HueTest_() {}
uint8_t hue = 0;
kaleidoscope::EventHandlerResult onFocusEvent(const char *command) {
Focus.read(hue);
return kaleidoscope::EventHandlerResult::EVENT_CONSUMED;
}
kaleidoscope::EventHandlerResult afterEachCycle() {
cRGB color = breath_compute(hue);
LEDControl.set_all_leds_to(color);
return kaleidoscope::EventHandlerResult::OK;
}
};I used the |
No description provided.