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

Using the Kelvin Slider #205

Answered by jaames
tqphan asked this question in Q&A
Discussion options

I need a Kelvin slider from range 2000-9000.

var temperature = new iro.ColorPicker('#temperature', {
 layout: [
 { 
 component: iro.ui.Slider,
 options: {
 sliderType: 'kelvin',
 minTemperature : 2000,
 maxTemperature : 9000,
 layoutDirection: 'horizontal'
 }
 },
 ]
});

On event 'input:end' I print to console using:

temperature.on('input:end', function(color) {
 console.log(color.kelvin);
});

The min and max values I got back were:
2000.2899169921875
8986.129760742188

Am I using the kelvin slider correctly?

You must be logged in to vote

yes, the conversion between kelvin <-> rgb is just a rough approximation, so it's not extremely accurate and can sometimes give weird values

Replies: 1 comment

Comment options

yes, the conversion between kelvin <-> rgb is just a rough approximation, so it's not extremely accurate and can sometimes give weird values

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
2 participants

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