Skip to contents

Returns shades of colours

Usage

get_shades(colours = c("#808080"), shades = 3)

Arguments

colours

A character vector of colours recognizable by R, to produces shades of

shades

A numeric vector giving the number of shades for each colour

Value

A list consisting of hex codes describing the shades of each colour

Examples

## Shades for a single colour
get_shades(c("red"))
#> $red
#> [1] "#B20000" "#FF0000" "#FF4D4D"
#> 

## Shades for multiple colours
get_shades(c("red", "blue" ,"#A5F8E3", "#808080"), shades = c(2, 3, 4, 5))
#> $red
#> [1] "#CC0000" "#FF3333"
#> 
#> $blue
#> [1] "#0000B2" "#0000FF" "#4D4DFF"
#> 
#> $`#A5F8E3`
#> [1] "#21EEBA" "#63F3CE" "#A5F8E3" "#E7FDF8"
#> 
#> $`#808080`
#> [1] "#4D4D4D" "#666666" "#808080" "#9A9A9A" "#B3B3B3"
#> 

## A single value for shade would imply all colours get the same number of shades
get_shades(c("red", "blue" ,"#A5F8E3", "#808080"), shades = 2)
#> $red
#> [1] "#CC0000" "#FF3333"
#> 
#> $blue
#> [1] "#0000CC" "#3333FF"
#> 
#> $`#A5F8E3`
#> [1] "#76F4D4" "#D4FCF2"
#> 
#> $`#808080`
#> [1] "#666666" "#9A9A9A"
#>