Skip to content

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

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

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

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