passiomatic/elm-designer

Add a pure Elm color picker widget

passiomatic opened this issue · 0 comments

Currently Elm Designer uses HTML <input type=color..> to pick an element color. This is extremely simple to integrate but has several limitations.

We should adapt simonh1000/elm-colorpicker and extend it to allow users to pick recently used and theme colors too. Also we need to allow users to reset a color and set an "inherit" value (where applicable).

About colors and alpha

At this point specify an opacity value within the image picker seems an anti-pattern to me:

With a totally opaque color type, we can calculate contrast for accessibility evaluation easily. An alpha channel means we'd have to emulate browser mixing to do that, which I'm not sure is consistent.
— Source

So the idea is to provide a color picker without alpha value, and provide alternative UI controls to pick opacity value (for the record Adobe Photoshop does exactly that). At the moment I'm just waiting to Elm UI 2 to finalize and then follow its API.

Also interesting for the picker design: