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

How do I set the initial value for a value slider? #203

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

How do I set the initial value for a value slider?

var brightnessPicker = new iro.ColorPicker('#brightness', {
 layout: [
 { 
 component: iro.ui.Slider,
 options: {
 // can also be 'saturation', 'value', 'red', 'green', 'blue', 'alpha' or 'kelvin'
 sliderType: 'value'
 }
 },
 ]
});
You must be logged in to vote

it takes its value from the color's value; the "V" in "HSV". You need to provide an initial color to set that

var brightnessPicker = new iro.ColorPicker('#brightness', {
 color: {
 h: 0,
 s: 0,
 v: 50 // initial value
 },
 layout: [
 { 
 component: iro.ui.Slider,
 options: {
 // can also be 'saturation', 'value', 'red', 'green', 'blue', 'alpha' or 'kelvin'
 sliderType: 'value'
 }
 },
 ]
});

Replies: 1 comment

Comment options

it takes its value from the color's value; the "V" in "HSV". You need to provide an initial color to set that

var brightnessPicker = new iro.ColorPicker('#brightness', {
 color: {
 h: 0,
 s: 0,
 v: 50 // initial value
 },
 layout: [
 { 
 component: iro.ui.Slider,
 options: {
 // can also be 'saturation', 'value', 'red', 'green', 'blue', 'alpha' or 'kelvin'
 sliderType: 'value'
 }
 },
 ]
});
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 によって変換されたページ (->オリジナル) /