Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EuiColorPicker needs to support opacity #2629

Closed
cchaos opened this issue Dec 11, 2019 · 8 comments
Closed

EuiColorPicker needs to support opacity #2629

cchaos opened this issue Dec 11, 2019 · 8 comments
Assignees

Comments

@cchaos
Copy link
Contributor

cchaos commented Dec 11, 2019

In order to swap out more instances in Kibana (TSVB), the color picker needs to allow for an opacity slider.

image

elastic/kibana#52084

@thompsongl thompsongl self-assigned this Jan 23, 2020
@thompsongl
Copy link
Contributor

@cchaos Looking at the TSVB color picker, it changes its input to rgba when opacity < 1.
Do we want to open the EUI input to accept rgba, also, or keep it limited to hex (returning 8-digit values when opacity < 1)?

Based on their usage, it looks like the input might not even be in use when changing to EUI (might be a swatch button instead of the input)

Screen Shot 2020-01-29 at 4 36 02 PM

@cchaos
Copy link
Contributor Author

cchaos commented Jan 30, 2020

We'd probably have to use the inline version with an extra input they way the color stops popover does.

As to the hex vs rgba values, that's a good question. I assume most users would understand the alpha channel but not that adding 2 extra digits to a hex alters the opacity. However, I think supporting both complicates the component quite a bit.

Perhaps instead of just a single slider for opacity, there's also a small input to adjust the opacity value. Something like:

Frame 1

@thompsongl
Copy link
Contributor

Ok. In this case we could treat alpha (or full rgba) as a second return value, which would allow consumers to handle it however they want.

Also, @snide brought up the point that 8-digit hex values aren't supported in CSS in IE11 (and Edge), which I verified.

@thompsongl
Copy link
Contributor

Screen Shot 2020-02-04 at 3 25 08 PM

Screen Shot 2020-02-04 at 3 20 05 PM

I think I like the decimal representation better. The return value for onChange will probably be in decimal format regardless.

@cchaos
Copy link
Contributor Author

cchaos commented Feb 4, 2020

I think showing it as a percentage is more universally understood than decimal. Since the decimal notation is essentially a fraction.

@nreese
Copy link
Contributor

nreese commented Feb 9, 2020

Are there plans to provide a property to opt out of showing the opacity input?

@snide
Copy link
Contributor

snide commented Feb 9, 2020

Are there plans to provide a property to opt out of showing the opacity input?

It should be off by default. This is an optional feature.

@thompsongl
Copy link
Contributor

#2850 introduced opacity support

#3055 is a continuation of this, which would add new layout option and probably require a refactor/simplification of the EuiColorStops component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants