You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To set the color of a light, the documentation currently states:
Set the color hue of the light. The hue parameter in the HSV color model is between 0°–360° and is mapped to 0–65535 to get 16-bit resolution.
However, it's completely unclear to me, how to come from the three values h, s and v to this integer value. I tried to calculate it like this: round(h * 65535 / 360) however this only produces white light. I guess I need to combine the three values together and somehow map it into the 0–65535 range.
Maybe an example in the documentation how to come from H, S and V to this integer value would help to understand it better.
The text was updated successfully, but these errors were encountered:
Okay, now it's working with round(h * 65535 / 360). Don't know what I did wrong. In Javascript:
varhue=Math.round(colorHsv.h*65535/360);// hue is 0-360 degrees, needs to be expressed between 0-65535varsat=Math.round(colorHsv.s*255/100);// saturation is 0-100%, needs to be expressed between 0-255
Is this the correct way to do it? What to do with v?
To set the color of a light, the documentation currently states:
However, it's completely unclear to me, how to come from the three values h, s and v to this integer value. I tried to calculate it like this:
round(h * 65535 / 360)
however this only produces white light. I guess I need to combine the three values together and somehow map it into the 0–65535 range.Maybe an example in the documentation how to come from H, S and V to this integer value would help to understand it better.
The text was updated successfully, but these errors were encountered: