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

How to change or destroy color picker

marekburiak opened this issue · comments

More of a question than an issue. Or maybe a feature request.

Is there a way to change options after color picker is created? Like for example to change layout. If not, is there a clean way to destroy an existing color picker (without causing memory leaks)?

commented

You can use the setOptions methods to pass new options to a color picker after it's been created, e.g:

const picker = new iro.ColorPicker("#picker", { 
  width: 300
});

// sometime later 
picker.setOptions({
  width: 400
});

Hope that helps!