I´m trying to write a custom widget that shows a lightbulb(or an icon of a lightbulb) according to a color item of my hue lamp. Is there a way to set the icon color to the color item, or maybe the background of the item to the according color?
to control the color of a glyphicon in a container/button
1 Like
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
6
Thanks Christopher
I’ll give that a try.
Just to be uber clear…
Is the item your container button is looking for named something like
LightColour_rgb_String
And how is the RGB string presented in that string, for example, are the three values HEX or Decimal, comma separated or fixed lengths?
I did see somewhere that the Color style can accept HSL values which might save some conversion.
I have had a look at the NodeRed Dashboard, with the idea that I’d use the colourpicker there, but the HSL values are very formally presented (within the payload) so there’s a need for conversion In & Out.
@MDAR Did you work this out as I am trying to work out the same thing? How to get the style to change based on the color inside a color item?
EDIT:
Possibly this is done by setting the colour info with a rule into a new string item and using that. I’m hoping there is a more elegant solution to this…
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
10
Sorry Matt
I stopped once I got the colour to change at will.
Styling it seemed less important, the more I realised that it was beyond my skilset.