elastic / eui

Elastic UI Framework 🙌
https://eui.elastic.co/
Other
58 stars 842 forks source link

Color Picker - possibility to show only accessible colors in color spectrum #8191

Open gvnmagni opened 2 years ago

gvnmagni commented 2 years ago

Describe the feature:

Currently the color picker allow the users to pick any color from the whole spectrum, while this is an important feature that allow customization the user might inadvertently create a set of color that is not accessible where the color contrast is not respected. It would suggest to improve our color picker in a way that will let the users pick only colors that are accessible in that specific context.

Current behaviour:

Screenshot 2022-05-31 at 10 20 57

Current potential result:

Screenshot 2022-05-31 at 10 25 37

Describe a specific use case for the feature:

In most of charts this is not a problem since there is little (or even none) overlapping of shapes, but in charts such as Gauge or Metric we have visual elements behind text or behind other shapes. In these cases it would be awesome if the color picker could automatically detect the color of the element in foreground (could be text, or the gauge progressing bar) and could filter out from the color spectrum colors that don't provide a sufficient contrast.

Screenshot 2022-05-31 at 10 23 53
elasticmachine commented 8 months ago

Pinging @elastic/kibana-visualizations (Team:Visualizations)

markov00 commented 8 months ago

Color by terms already shows if the chosen color have enough contrast with the background. Color by range needs to be adjusted accordingly