Color Modal dialog presets

When I use a modal color dialog in a widget (aCKolor), there are a set of colored circles that are the most recently picked colors from the color wheel. Clicking on one of these instead of the color wheel allows you to set your light back to a recently used color.

Is there a way to instead have a set of pre-defined colors show up in the dialog?

Thanks,

Bruce

Sorry, no, this is not supported.

So what would be required to implement this? Update the javascript code for the aCKolor widget?

Or is there a way to implement this within HABpanel?

Yes.

OK - so is the aCKolor widget js code part of the installation (where can I find it?), or is it embeded in HABPanel in some way?

It’s a bower (bower.io) dependency, see here:

And it’s acutally a fork I made, not the original version, because I needed to make some changes to make it work in HABPanel.
So you would need to fork it too (from mine), make your changes, rebuild it, push it back to your repository, then change the reference to your fork in bower.json and rebuild HABPanel (with gulp, see https://github.com/openhab/org.openhab.ui.habpanel/blob/master/CONTRIBUTING.md#build-environment).

If you’re not used to this, it’s rather complex…
See also https://github.com/openhab/org.openhab.ui.habpanel/issues/165 for a similar question.

Good luck!

Is there a way to make use of this simpler color picker using lazy-load?

If not, can I add it by rebuilding as you suggest?

In any event, I can’t find bower.json - I’ve searched in /usr/share/openhab2 and /var/lib/openhab2. Where can I find it?

Thanks,

Bruce

You probably can build your own directive around it, but it won’t be easy either, even if you get it to show up on the screen, the most complex part is to make sure the item’s state and the color picker are linked (an update to either one triggers the update of the other etc.). On top of that most color pickers around use RGB or HSL and openHAB uses HSV, so you’ll have to perform the conversions in your code.

In the repository, that’s a development file, it’s not part of the distribution.