Skip to contents

Get the hex color codes used by the cleanplots color scheme, either the full palette or specific colors by name.

Usage

cleanplots_colors(..., bars = FALSE)

Arguments

...

Character names of colors to return. If none are specified, all colors in the palette are returned. Available names: "red", "ltblue", "black", "gray", "purple", "pink", "navy", "ltgray", "dkgray", "lavender".

bars

Logical. If TRUE, return the softer bar/area versions of the colors (the colors Stata's cleanplots scheme uses for bar charts, area plots, and pie charts). Default is FALSE (the main colors used for markers and lines).

Value

A named character vector of hex color codes.

References

Mize, T. D. cleanplots: Stata graphing scheme. https://www.trentonmize.com/software/cleanplots

Examples

cleanplots_colors()
#>       red    ltblue     black      gray    purple      pink      navy    ltgray 
#> "#D50000" "#8FC6EB" "#000000" "#909090" "#740074" "#FFB3D9" "#143755" "#C0C0C0" 
#>    dkgray  lavender 
#> "#404040" "#D9D7F0" 

cleanplots_colors("red", "navy")
#>       red      navy 
#> "#D50000" "#143755" 

cleanplots_colors(bars = TRUE)
#>       red    ltblue     black      gray    purple      pink      navy    ltgray 
#> "#FF4D4D" "#C2E0F5" "#5F5F5F" "#B1B1B1" "#AF5FAF" "#FFDBEE" "#5D7A93" "#D3D3D3" 
#>    dkgray  lavender 
#> "#909090" "#E8E7F6"