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

Update colour palettes #1

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Update colour palettes #1

wants to merge 7 commits into from

Conversation

trallard
Copy link
Member

@trallard trallard commented Aug 1, 2024

This PR updates the sequential and diverging colour palettes based on work by @smeragoel

Sample plots are located in examples/images, there is a folder for each of the colour palettes and themes (light, dark)

Copy link
Collaborator

@isabela-pf isabela-pf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there! I’m reviewing this as requested, but I’m not confident I have all the right information since I can’t find any versions of these same visualizations with the last version’s colors. I still have feedback, just disregard anything that seems outright misinformed about the state of the palettes.

On the highest level, none of the changes stand out to me negatively. This looks like additions that address issues with the limits of the previous palettes (e.g. no categorical options, colors not shifting well between light and dark backgrounds) and do so in a way that labels it for anyone using the visualization package. I don’t think there will ever be a single right answer for data visualization color palettes in terms of visual accessibility concerns, so adding options seems like an appropriate choice.

Questions and comments in no particular order, but numbered for easy reference:

  1. Visualizations with their data points outlined/with gaps between them and the next data are the most effective to me. They have the best contrast and ensure contrast because we always know what colors to calculate for. I am seeing this almost exclusively on the bar plots and distribution plots. I also think any plot using lines works for the inverse reason. I would love to see this approach on more of the plots and as a standard for the palette, but I understand that may be beyond the scope of a color palette package and more in how the plots themselves are structured when generated. I also understand some plot types rely on transparency and overlapping data points to communicate, so that may provide an additional challenge.
  2. While I did not recheck every single color against its background for WCAG contrast ratios (I think this has already been done), a majority of them appear to have sufficient contrast. Ones that appear more low contrast to me are
    a. The blues from both categorical palettes on dark backgrounds.
    b. The purples from both categorical palettes on dark backgrounds.
  3. This revision improves the luminance of all the colors on dark backgrounds. This is awesome and helps with contrast! Great job!
  4. This revision also maintains the hue of each color really well. Even when on light and dark backgrounds or in one-color palettes it feels like the same color. I think this is a big improvement!
  5. One-color palettes—including grayscale—do still struggle to differentiate colors from others in the data set. I do think they have good contrast on their backgrounds, but not with each other. I say this knowing from experience how basically impossible it is to do both at once. This is when I’d recommend adding a non-color differentiation to one-color palettes such as outlines or textured/patterned fills. I do not know if this is out of scope for this project at the moment.
  6. I am not finding any issues with green and red being used side by side or analogous colors like blue and purple with close value. I think there is good enough variety on the whole that these should work okay with color blindness.
  7. I was happy to find a grayscale addition in this revision! Hooray!
  8. I am guessing the psf colors are from the Python Software Foundation? They look fine, but I’m not sure if there’s a reason behind this.
  9. Do the “bright” categorical colors come from somewhere? I have no specific complaints about them, they just don’t share colors with any of the other options as far as I am aware.

@smeragoel
Copy link

Thanks for compiling this @trallard! I'll try to also address @isabela-pf's feedback and keep the review structure and bullet numbering similar for easier discussion. Here’s what I think:

  1. I agree with Isabela that the plots are most effective with gaps, outlines, and patterns. The core issue here is that it's not possible to achieve a 3:1 contrast between adjacent colors while also maintaining a 3:1 contrast against the background. I think we should acknowledge these limitations and document strategies to mitigate some of these issues by providing best practices, such as using patterns, gaps, outlines, etc.

  2. I double-checked all the colors for minimum contrast against the background. The updated colors (sequential and divergent palettes) meet the minimum requirements, as do the unchanged categorical colors. Some colors have a lower contrast than others (e.g., cat_colorful_dark: "Cyan" #5073B7: 3.19), but they still meet the minimum contrast.

  3. I agree that the luminance, especially in the dark palette, turned out beautifully. However, I’m wondering if the light versions appear more muted or desaturated compared to the dark versions?

  4. Hard agree - I would refer to point 1 above. I think the grayscale is particularly problematic when it comes to color distinction, so I’m considering tweaking these colors. Grayscale is a common enough use case (e.g., color blindness, printed plots) that it deserves a rethink, in addition to the pattern/gap/outline workaround.

  5. Only the sequential and divergent palettes were updated, and the categorical colors remain unchanged from the original palette. I forget the history behind these colors, but I think @trallard should be able to provide more context on these.

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

Successfully merging this pull request may close these issues.

3 participants