Does anyone here understand color spaces? #22008
Replies: 3 comments 6 replies
-
It's a bit tricky, lights can be in xy, hue/sat, or color temperature mode. Which ones are supported depend on the hardware. Philips Hue supports all 3 usually. Ikea either xy or color temp depending on the bulbs. https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/lib/color.ts Has the code that deals with the conversions. We try to use the color mode the device reports as active to parse and map that to the others so the properties in the mqtt payload stay in sync. Or you can also disable that behavior. (Which i personally do and manually deal with it based on the color_mode property) |
Beta Was this translation helpful? Give feedback.
-
zigbeealliance.orgChapter 5.2.2.2.1 should cover most of it~ sjorgeOn 5 Apr 2024, at 17:18, Yellow-Subroutine ***@***.***> wrote:
Thanks for the reply, I'll have a look at the code and see if it solves my problem.
But just to understand the issue:
A color temperature determines the color but not all colors have a corresponding temperature - so by using color temperature you only use a subset of all possible colors - is that correct?
And xy alone do not yet specify a color - you need an extra dimension, which I assume here would be given by the brightness.
So brightness, x and y determine the color as would brightness, hue and saturation - do I have the right picture here?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Came across this discussion whilst trying to understand colour spaces. What I'm trying to do is send in a Hex colour: Hex #0f4452 translates to RGB 15,68,82 so in theory I should be able to convert x=0.1639 and y=0.2801 to that RGB, however I can't figure out how to do so. Using the methods from color.ts to attempt conversion:
rgbColour is 0.058823529411764705, 0.26666666666666666, 0.3215686274509804 (as expected) I feel like I'm missing something obvious here but I'm not sure what. Any help would be much appreciated. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have an Ikea light bulb that accepts rgb-values for setting the colour, however the state messages it sends look like this:
``{"brightness":254,"color":{"hue":0,"saturation":100,"x":0.7006,"y":0.2993},"color_mode":"xy"
so it uses (I think) the xyY color-space, however it also reports hue and saturation which as far as i understand it are not independent of x and y.
i would like to translate such a message into an corresponding rgb-value but so far have not figured out how to do this.
Does anybody here understand this?
Beta Was this translation helpful? Give feedback.
All reactions