clr_darken: Programmatically darken colors

View source: R/hypoimg_generic.R

clr_darkenR Documentation

Programmatically darken colors

Description

superseded: Please use prismatic::clr_darken() instead

Usage

clr_darken(color, factor = 0.5)

Arguments

color

string (color, mandatory)

factor

numeric scalar (optional), between 0 and 1, amount of darkening

Details

clr_darken produces a darker version on given colors.

Takes a vector of colors and darkens them by a given factor. 1 returns the input color, 0 returns black.

See Also

clr_lighten

Examples

ggplot(tibble( x = 1:5))+
  coord_equal()+
  geom_tile(aes(x = x, y = 1, fill = factor(x)))+
  scale_fill_manual(values = map_chr((1:5)/5,.f = clr_darken, color = clr2[[2]]))+
  theme_void()+
  theme(legend.position = 'none')


k-hench/hypoimg documentation built on June 2, 2022, 1:49 a.m.