eltos / SimpleDialogFragments

An Android library to create dialogs with ease and handle user interaction reliably, using fragments and material design.
Apache License 2.0
119 stars 17 forks source link

Add alpha to SimpleColorDialog #46

Closed riccardoch closed 5 years ago

riccardoch commented 5 years ago

Is it possible to add alpha channel to SimpleColorDialog when we click on "color palette" button to edit the choosen color (like for SimpleColorWheelDialog)?

Library version 3.0

eltos commented 5 years ago

Currently there is no such option as the ColorDialogue does not support transparency very well (e.g. no chess-tile background).

I once decided against implementing it because considering the other color fields might have no or arbitrary alpha values, I felt this might be confusing for the user and I couldn't think of a good use-case. In most cases I could imagine it seemed favourable to have a separated setting for the alpha value, independent of the color. However, it seems I was wrong 🤷‍♂️

I wonder what your use-case is?

riccardoch commented 5 years ago

I'm developing a Home Automation app, and the color picker helps me to send color value to RGB lights; the alpha value is needed to set the amount of color and is common for RGB lights. At the moment I'm extending SimpleColorDialog class and it seems to work correctly.

eltos commented 5 years ago

I'm wondering weather it's better to have a common alpha-slider below the color fields in the ColorDialog rather than having only the slider in the (subsequently opened) ColorWheelDialog that will be valid only for the customizable color? Maybe we can have both, but linked and valid for all fields?

riccardoch commented 5 years ago

I think is enough in the ColorWheelDialog, because in the SimpleColorDialog there are pre defined colors, which can already include alpha channel

riccardoch commented 5 years ago

I think the "palette" button could be tinted wihout transparency, because transparancy tells how much the color is saturated and not which color is.

eltos commented 5 years ago

There's now a method to enable the alpha slider: setupColorWheelAlpha