Uses colortools package (and possibly scales) to easily create a color palette based on a initial input color.
create_palette(colorhex, name = NULL, toHCL = FALSE, plot = FALSE, alpha = 1)
colorhex | Hexadecimal value of color or an R color name. |
---|---|
name | optional name of color |
toHCL | Convert colors to hcl. Defaults to |
plot | Plot the results. Defaults to |
alpha | Transparency. Takes values from 0 to 1. Default is 1. |
A list of colors
Will return complementary, analogous/adjacent, split complementary, triadic, square and tetradic color values relative to the initial color. Note that if you want sequential, qualitative, diverging etc., other packages like RColorBrewer, colorspace, and colortools will do that for you.
#> $orange #> [1] "#ff5500" #> #> $complementary #> [1] "#FF5500" "#00AAFF" #> #> $analogous #> [1] "#FF5500" "#FFD500" "#FF002B" #> #> $split_complentary #> [1] "#FF5500" "#00FFD4" "#002BFF" #> #> $triadic #> [1] "#FF5500" "#00FF55" "#5500FF" #> #> $square #> [1] "#FF5500" "#2AFF00" "#00AAFF" "#D500FF" #> #> $tetradic #> [1] "#FF5500" "#AAFF00" "#00AAFF" "#5500FF" #>create_palette(colorhex = '#ff5500', name='orange', alpha=.5)#> $orange #> [1] "#FF550080" #> #> $complementary #> [1] "#FF550080" "#00AAFF80" #> #> $analogous #> [1] "#FF550080" "#FFD50080" "#FF002B80" #> #> $split_complentary #> [1] "#FF550080" "#00FFD480" "#002BFF80" #> #> $triadic #> [1] "#FF550080" "#00FF5580" "#5500FF80" #> #> $square #> [1] "#FF550080" "#2AFF0080" "#00AAFF80" "#D500FF80" #> #> $tetradic #> [1] "#FF550080" "#AAFF0080" "#00AAFF80" "#5500FF80" #>