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 identify whether the target of input events?

usernein opened this issue · comments

Hello, is there a way of identifying whether i'm changing the color via a slider or a wheel?

I actually use a wheel for selecting the color and a slider with sliderType==kelvin to adjust the color temperature. I'm using it in Home Assistant with a smart bulb.

I want to, whenever i adjust the temperature through the slider, adjust the temperature of my bulb so it will turn white, but the color and the temperature settings uses different methods so i need to identify which one i am actually adjusting to use the right method.

commented

Not really possible to do this with a single color picker, but you could perhaps create separate color picker instances - one that just has a slider, one that just has a wheel, and then respond to events from them with whatever logic you wish.