Skip to content

EuiColorPicker needs to support opacity #2629

Closed

Description

@cchaos

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

image

elastic/kibana#52084

Activity

  1. self-assigned this
    on Jan 23, 2020
  2. thompsongl commented on Jan 29, 2020

    @thompsongl
    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

  3. cchaos commented on Jan 30, 2020

    @cchaos
    ContributorAuthor

    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

  4. thompsongl commented on Feb 3, 2020

    @thompsongl
    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.

  5. thompsongl commented on Feb 4, 2020

    @thompsongl
    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.

  6. cchaos commented on Feb 4, 2020

    @cchaos
    ContributorAuthor

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

  7. nreese commented on Feb 9, 2020

    @nreese
    Contributor

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

  8. snide commented on Feb 9, 2020

    @snide
    Contributor

    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.

  9. thompsongl commented on Mar 12, 2020

    @thompsongl
    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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions