Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

color temperature (kelvin) and value (luminosity) relationship #188

Answered by jaames
Christian-Me asked this question in Q&A
Discussion options

Hi,

first, thank you for that fantastic widget. I integrated it into a Node-RED dashboard widget and it works (nearly) prefect!

I ran into a problem trying to control a tunable white led strip with 3000k and 6000k leds. I use the temperature to control the relationship between the warm white and cold white leds and the value to control the intensity. I thought it would be nice and easy to combine a value and a kelvin slider. The value slider gets colored when I move the temperature, nice. But the temperature slider don't fade together with the value. But the value always jumps to 100% when the temperature changes. Moving the value slider correctly don't change the value.

image

It would be great if changing the temperature would let the value constant. I looked briefly into the code and found that the conversion of the temperature is "only" to RGB and this likely erases the lightness information.

Any ideas how the get both in sync? (I can have separate sliders for value and temperature and mix the data in Node-RED as a workaround)

Here an example: 1st a combined widget (with the value problem) and second two separate widget)
image

You must be logged in to vote

The value slider is tied to the "V" channel in the HSV color model, and when dealing with Kelvin temperatures it goes from Kelvin -> approx. RGB -> HSV, which is why you see that slider jump around. This is also why I don't think it makes sense to detach the value slider from Kelvin either - iro.js only works with digital color, not light.

While I know a lot of people use iro.js to drive LEDs, that stuff really isn't my wheelhouse, so I never really designed it for dealing with light or anything. In the future I'm considering adding a way to define your own custom slider types, but that needs a lot of work and thinking. :)

As a workaround for now, you could just use two separate colorPick...

Replies: 1 comment

Comment options

The value slider is tied to the "V" channel in the HSV color model, and when dealing with Kelvin temperatures it goes from Kelvin -> approx. RGB -> HSV, which is why you see that slider jump around. This is also why I don't think it makes sense to detach the value slider from Kelvin either - iro.js only works with digital color, not light.

While I know a lot of people use iro.js to drive LEDs, that stuff really isn't my wheelhouse, so I never really designed it for dealing with light or anything. In the future I'm considering adding a way to define your own custom slider types, but that needs a lot of work and thinking. :)

As a workaround for now, you could just use two separate colorPicker instances; one with a value slider and another with a kelvin one, and control them with your own code.

You must be logged in to vote
0 replies
Answer selected by jaames
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /