Skip to content

Request: scale_color_colorblind() without black #178

@rcragun

Description

@rcragun

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions