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

Request: scale_color_colorblind() without black #178

Open
rcragun opened this issue Aug 26, 2024 · 0 comments
Open

Request: scale_color_colorblind() without black #178

rcragun opened this issue Aug 26, 2024 · 0 comments

Comments

@rcragun
Copy link

rcragun commented Aug 26, 2024

Feature request

Feature request: option to not use black with scale_color_colorblind(), scale_fill_colourblind, etc.

Justification

Black is often the default color for figure content (and for content like text that surrounds figures). It seems like using black for one group, orange for another, and blue for another implies that the data in black are the default or baseline, which is often not what we want colors to communicate.

See this stackoverflow question for discussion.

Ideas for implementation

This could be a separate function: scale_color_colorblindcolors().

The option could be controlled by an argument to scale_color_colorblind() with the default set to include black: black=TRUE or noblack=FALSE.

Workaround

This is what I currently use as a workaround:

scale_color_colorblind2 = function(.color_list = 2L:8L, ...){
    scale_color_discrete(..., type = colorblind_pal()(8)[.color_list])
}

By default, this scale omits black, but you can pass a vector of color positions to .color_list to specify which colors in the colorblind palette to use.

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

No branches or pull requests

2 participants
@rcragun and others