jaames/iro.js

Is it possible to set default lightness?

martynaskre opened this issue · 1 comments

For my use case lightness slider is not really required. So is it possible to set default lightness?

You can pass a default color to the color picker constructor. If you're not using the lightness slider, then obviously the user will have no way to change the lightness from whatever lightness value your default color has.

If you want a specific lightness value, then setting the default color from a HSV object is the easiest way to do that:

var colorPicker = new iro.ColorPicker(".colorPicker", {
  color: {
    h: 180,
    s: 100,
    v: 100 // <- default lightness level, as a percentage
  }
});