nealmckee / penumbra

Penumbra Color Theme
MIT License
1.4k stars 31 forks source link

R package #2

Closed hughjonesd closed 2 years ago

hughjonesd commented 2 years ago

Hey, Just to say I saw this on HN, liked it and built an R package based on it: https://github.com/hughjonesd/penumbra. Comments welcome, and do tell me whether I am crediting you appropriately! Cheers, David

nealmckee commented 2 years ago

Hey, I didn’t expect anyone to be quite as quick, I’m glad to have sparked such enthusiasm!

I haven’t touched R in quite a a while, but from what I can gather this is not for syntax highlighting in RStudio but for use as a categorical colour palette in visualisations?

If that’s the case, please include the caveats about only using this for your own exploration as it is not accessible for people with colour vision deficiencies (colour blindness) and therefore should never be used in scientific visualisations — something I care about a lot.

Any particular reason why you chose 7 colours over 6 or 8?

Credit is adequate and once these two points are resolved, you or I can add the implementation to the readme.

hughjonesd commented 2 years ago

No, they're all available, you can use any n from 2 to 8.

Have you plans to fix the colourblindness issue? David

On Fri, 5 Aug 2022 at 14:43, Neal McKee @.***> wrote:

Hey, I didn’t expect anyone to be quite as quick, I’m glad to have sparked such enthusiasm.

I haven’t touched R in quite a a while, but from what I can gather this is not for syntax highlighting in RStudio but for use as a categorical colour palette in visualisations?

If that’s the case, please include the caveats about only using this for your own exploration as it is not accessible for people with colour vision deficiencies (colour blindness) und should never be used in scientific visualisations — something I care about a lot.

Any particular reason why you chose 7 colours over 6 or 8?

— Reply to this email directly, view it on GitHub https://github.com/nealmckee/penumbra/issues/2#issuecomment-1206474513, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMMT5ZI4HMVFHYKMOXEXRTVXULARANCNFSM55VZU6NQ . You are receiving this because you authored the thread.Message ID: @.***>

nealmckee commented 2 years ago

Ah, nice, it looks like you are just sampling along the hue axis, right? Ideally, if you have time, it would be awesome if you could implement them according to the guidelines for subsetting I outlined here in the main repository. This would require specifying every palette below 6 manually, as well as some subjective choices with which colours to start.

It also looks like you’re offering the different contrast levels, which is great, but then you should definitely specify to only use the version with more contrast on a dark (or perhaps pure white, though this is not recommended) background.

Unfortunately, it is impossible to make this palette work for people with colour vision deficiency. The abridged version is that they simply cannot differentiate enough hues to be able to use only hue to encode categories.

hughjonesd commented 2 years ago

Done.

Re colourblindness. Why not do the minimum necessary? It's a nice palette, and breaking the principle of pure hue might still make a nice palette. The key selling point (I think) is "it's natural" rather than "it's only based on hue".

nealmckee commented 2 years ago

Great, I’ve added it to the README, including the installation instructions.

Unfortunately the minimum necessary is quite a lot. As alluded to here, one needs to use a relatively large amount of luminance contrast between colours to make any palette work for people with CVD. Shifting hues is not even close to sufficient and even including chroma would probably not be enough.

I disagree on the main feature which is in my opinion the uniform luminance and chroma of the accent colours. If/once I finish work on a fully optimized palette for accessibility, I will look into using it for syntax highlighting (which is not guaranteed to work with the background colours of Penumbra),

nealmckee commented 2 years ago

Oh, could you please also add the note about not being colour blind friendly to the main readme (ideally by adding that part to the quote at the bottom)? That’s what I meant in the first place though of course it should also be in the docs.

hughjonesd commented 2 years ago

Will do!