I noticed that one section of the code within the ColorFromXYmethod within Q42.HueApi.ColorConverters.Original->HueColorConverter does not quite match the code shown in the HueAPI docs.
Here is the Q42 code:
float x = (float)xy.x;
float y = (float)xy.y;
float z = 1.0f - x - y;
float Y = 1.0f;
float X = (Y / y) * x;
float Z = (Y / y) * z;
float x = x; // the given x value
float y = y; // the given y value
float z = 1.0f - x - y;
float Y = brightness; // The given brightness value
float X = (Y / y) * x;
float Z = (Y / y) * z;
Notice that the Q42 code sets Y to 1f, but HueAPI indicates it should be set to the target brightness.
Though the HueAPI docs are unclear about how to properly handle Y relative to a Hue light brightness value.
I noticed that one section of the code within the
ColorFromXY
method withinQ42.HueApi.ColorConverters.Original->HueColorConverter
does not quite match the code shown in the HueAPI docs.Here is the Q42 code:
...and here is the code from the HueAPI docs:
Notice that the Q42 code sets
Y
to1f
, but HueAPI indicates it should be set to the target brightness.Though the HueAPI docs are unclear about how to properly handle
Y
relative to a Hue light brightness value.