-
Notifications
You must be signed in to change notification settings - Fork 27
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
Actual light colors? #28
Comments
Isn't this a duplicate of this issue: #20 ? Or am I misunderstanding your request? |
Sorry for being unclear. Here's the design I'm working on: The colors of the buttons on the right are achieved simply by putting the desired color state of the light entity into rgb-light-card, so there's some translating going on. I was thinking it must be possible to get the state from the entity dynamically. The bottom button-card is using |
The slider can already handle color_temp? The old slider has the 'warmth' key which in turn will change the color_temp of the light. temperature is handling color_temp attribute on a light. I have thought about it a little, and I am not mathematician or lights expert. So I do not know how I would start implementing a dynamic slider with one value, to handle both hue AND saturation at the same time. Then the slider value range would have to be insanely huge to be able to handle just hs_color. It would have to handle hue 0-360 and saturation 0-100. So the slider range should be 36.000? So it can handle all combinations? I have also thought about the rgb, rgbw, rgbww and xy_color color modes. And it is the exact same dilemma with all of them. So as a start I am implemented them all, but separately. And then I might be able to figure something out down the line. But that is pretty low priority unless someone comes around with the perfect formular for calculating hue/sat from a single slider value. |
I'm thinking as a start I might be able to make a template slider where you set what happens on specific percentages on the slider. Then you could use a linear gradient to set the slider color to match the actions specified. This is actually something I think some people could find useful. I could think of a few scenarios where I could use something like that. So I will probably implement something like that to the new slider as well. |
Have you looked at this? |
It doesn't resolve to anything? |
Sorry about that, seems there are some issues with internal linking on github. I just copied from the address bar. This is the correct link, but I can only open by right click > go to... https://github.com/NAStools/homeassistant/tree/master/homeassistant/util/color.py Interesting part begins at line 170. |
Yes there are some interesting snippets that I will definitely look at more in depth when time comes to implement RGB colors and XY colors since there are some nice functions to convert from one to the other. This might also help me create temperature sliders for RGB lights not supporting setting temperature natively. But not something I will look at, at the moment. Is it me who is blind, but I do not see how that relates to creating RGB/XY/HS colors from a single value? Don't get me wrong, I appreciate the link and I think it will help me down the line when time comes. But these snippets will only help me when the first part is done, and that is creating the colors from a slider value. |
I think there's som miscommunication here. To be clear: My initial request was not about controlling the state of the light, but using the state to calculate colors to be used in the graphical interface. Glad to hear the link was of some use, though. |
Ahh I see, yeah I have misunderstood what it was you were asking. I apologize. But I agree, it could also be a nice build in feature and something I will take into consideration when I have fixed some of the other stuff. |
For anyone interested, i got it working in this way: progress:
- background: |
[[[
return `rgb(${entity.attributes.rgb_color})`
]]] |
Thanks! Here the solution to handle both rgb and non-rgb lights for me
|
Late to the party, but this does not work for me (with a philips hue bulb). progress: gives me:
|
I'm using rgb-light-card to choose light temperature. The card does a good job of using light temperature values to color the buttons.
button-card does something similar, but is suffering under some HA issue as far as I can tell.
Again, amazing work! Hope we get to see some great features before life comes knocking :-)
The text was updated successfully, but these errors were encountered: