Learn R Programming

ggblanket (version 10.0.0)

aes_colour_darken: Lighten/darken a colour/fill aesthetic

Description

Lighten/darken a colour/fill aesthetic based on a

  • aes_colour_darken() Darken a colour aesthetic, relative to a fill aesthetic

  • aes_colour_lighten() Lighten a colour aesthetic, relative to the fill aesthetic

  • aes_fill_darken() Darken a fill aesthetic, relative to a colour aesthetic

  • aes_fill_lighten() Lighten a fill aesthetic, relative to the colour aesthetic Can be spliced into ggplot2::aes with rlang::!!!.

Usage

aes_colour_darken(..., amount = 0.1)

aes_colour_lighten(..., amount = 0.1)

aes_fill_darken(..., amount = 0.1)

aes_fill_lighten(..., amount = 0.1)

Value

A ggplot2 aesthetic

Arguments

...

Other arguments passed to colorspace::darken()/colorspace::lighten().

amount

Numeric specifying the amount of lightening or darkening.

Examples

Run this code
library(ggblanket)
library(ggplot2)
library(palmerpenguins)

set_blanket(
  alpha_recursive = 1,
)

penguins |>
  gg_bar(
    y = species,
    col = island,
    mapping = aes_colour_darken(amount = 0.2),
    width = 0.75,
  )

penguins |>
gg_bar(
  y = species,
  col = island,
  mapping = aes(!!!aes_colour_darken(amount = 0.2)),
  width = 0.75,
)

Run the code above in your browser using DataLab