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

Feature: Specify min/max for default slider color, but not actual value

aletheia7 opened this issue · comments

I am using the default color picker. When I set the color wheel/slider to #000a07, the wheel/slider turn black. I use the color picker to set colors for an LED device. When I set my LED device to #000a07, I get a nice low green color, but the picker/slider only shows black.

I would like to have a rgb/hex color correction setting so that the wheel/slider can show some color when I use very low values close to black.

Thank you.

commented

if I understand what you're asking, color/gamma correction is something that can vary wildly depending on LED hardware. iro.js is intended to be a general purpose color picker, not an LED driver, so I don't think it would be reasonable to add this into the core library?

You'll probably want to run the color that iro.js gives you through your own math to adjust it to suit whatever LED stuff you're working with

Perhaps this is a color picker bug? When I set the color picker to value #000a07 (rgb(0, 10, 7)) it displays rgb(0, 0, 0).

commented

Are you sure? #000a07 is just a very dark color, have you tried using a tool to give you the actual on-screen color?

Here's a video showing the on-screen colors in the latest build of iro.js running in Chrome on macOS. Note that the red channel is off because I'm using a screen filter, but the colors shown in the wheel are otherwise accurate:

out.mp4

Here's #000a07 in a third party color picker:

Screenshot 2021-03-28 at 14 33 35

Here's a screenshot of Chrome Developer Tools Inspector showing "fill: rgb(0,0,0)" of the Picker when it is set to #000a07:
Screenshot

commented

that is expected; the wheel lightness works by positioning a black circle over the wheel and changing its opacity depending on the lightness level. more lightness = less opacity, and therefore more of the color underneath (from the hue and saturation parts of the wheel) will show. its a bit of a weird trick but its cheap, easy, and accurately mixes the color on the wheel. you can see the opacity style is present in the screenshot you sent