jaames / iro.js

🎨 Modular color picker widget for JavaScript, with support for a bunch of color formats

Home Page:https://iro.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update the border color on input?

Newbrict opened this issue · comments

Hi, I wanted to have the border color update to the selected color. I tried this:

color_picker.on('color:change', (color) => {
  color_picker.borderColor = color.hexString;
});

But the border does not get redrawn. Is this possible with iro currently?
Thanks.

commented

i think i forgot to document it but there is a setOptions method that can update props after the color picker has been created. color_picker.setOptions({borderColor: color.hexString}); should do it.

i think i forgot to document it but there is a setOptions method that can update props after the color picker has been created. color_picker.setOptions({borderColor: color.hexString}); should do it.

That works, thank you.