-
Notifications
You must be signed in to change notification settings - Fork 841
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
Updated color blind viz palette #2686
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave the code-review up to others who are more familiar with EUI than I am. From the design perspective, I think you did a great job balancing the constraints of accessibility with the desire for a strong color palette to work with. 💯
Actually, lets hold on reviewing this PR at the moment. Based on @formgeist's concerns with changing the hues of some of these colors, I'm in the process of altering the palette again to better match the original hues. |
I've been playing with this a bit this morning, trying to add some saturation back, as my concern is that we're heading down a similar path as the badges. It seems as though there is some room for adding more saturation while remaining color blind safe... ... I'll wait to see your next update, thanks! |
@mdefazio Yeah there probably should be a rule mentioned about this somewhere. Though I do hope that most charts aren't actually stretching the colors that much that they really are using the 3 rotationed color blind palette. That's more for how to handle user-generated charts. @ryankeairns I totally understand your concerns. However, there was private feedback given that our current palette was too saturated (hot) and that we needed to bring it down (quite a bit). #2238 (comment) I also agree that when you actually start plotting these colors in charts, the saturation becomes a bit blinding. Let's continue this particular discussion over on the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks amazing! 😍
I prefer the new colors with less saturation because they follow more natural patterns of color. They look like they belong to the same family.
This is a very interesting article about finding the right color palettes for data viz: article
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this as a team along with @VijayDoshi to explain the "breaking" nature of this change. Summary of the discussion:
- We're good to merge this as is. It's a big improvement for what exists today.
- This has some very limited downsides towards usage in Avatars, badges and the like. @ryankeairns will do some follow up to think up a non-viz, but still varied pallette that has a bit more pop.
- This will require a Kibana follow up PR to adjust some hard coded values (KUI, the charting seeds...etc)
Given the later, my suggestion would be to merge after the holidays, but as soon as we get back.
Also... fantastic work. This is really very nice.
Ok, I've passed through the final round of palette updates and updated the summary of the PR. (Be sure to also check out the chart's palette selector). This is ready for review if anyone wants to get a head start on it before the holidays though, as @snide said, we won't actually merge until afterward. |
Ha. Yes. I should probably do an actual code review. I didn't do that as part of that approve but I'll do that today/tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Why must the palette have a key called colors instead of just passing back the array?
I don't see any reason why we can't just return an array of colors.
i.e: `palettes.euiPaletteColorBlind` -> `palettes.euiPaletteColorBlind()`
@ryankeairns I think this was mostly a question for you since you wrote the palette function.
Just wondering since needing to remember to add |
Co-Authored-By: Greg Thompson <thompsongl@users.noreply.github.com>
I don't recall any technical reason or intent to add more things to each palette, rather it provided a little readability to clarify exactly what I was requesting/getting returned. Feel free to strip it out. |
Thanks @ryankeairns. I'll go ahead and remove this since there's already a breaking change in the service anyway. I am also going to export the EUI palettes directly/individually so consumers don't have to write |
Now just returns the array of colors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
See this PR live: https://cchaos-viz-colors.netlify.com/#/utilities/color-palettes
Also be sure to check them out in the charts docs section: https://cchaos-viz-colors.netlify.com/#/elastic-charts/creating-charts
The new
euiPaletteColorBlind
paletteRead the description of how this was derived in this issue and fixes #2238
More quantitative palettes
And docs that show what happens when you pass different values for the number of steps.
Breaks and dependencies
This does cause some breaking changes to the
color_palette
function to be more robust by accepting an array of colors instead of a single start and end color.Before
Now
The
color_palette
function also adds a dependency on chroma.js for itsbezier
andcorrectLightness
functions.It also breaks the
eui_palettes
which used to just be a static array of hex colors. Now they are a function allowing consumers to pass a certain number of steps to interpolate.Before
Now
Also,
palettes
no longer exists as an exported object of palettes, and instead exports the named palettes directly likeexport const euiPaletteForStatus()
. And gets rid of the.colors
key so that each function just returns the array of colors.One could argue that we could/should change the white to color gradients when in dark mode to go from black to color. However, they're not too bad in dark mode as is and I wonder if that would change the meaning of the chart when toggling between themes. Anyhow, possibly/probably out of scope for this PR.
Checklist