Skip to content

Feature request: expand suite of colour manipulation functions #423

Closed
@teunbrand

Description

@teunbrand

{scales} already has some nice colour manipulation functions like alpha() and muted() powered by {farver}. It would be convenient if this suite could be expanded to include other common tasks related to colours, so that dependencies on {prismatic} or {colorspace} could be omitted for straightforward colour manipulation. Specifically, I had the following manipulations in mind.

  • col_shift() that takes a vector of colours and shifts the hue channel by some amount.
  • col_lighter() that takes a vector of colours and adds to the luminance channel by some amount.
  • col_darker() that takes a vector of colours and decreases the luminance channel by some amount.
  • col_saturate() that takes a vector of colours and adds to the saturation channel by some amount. Alternatively, a function that does the same for the chroma channel in HCL space.
  • col_mix() that interpolates between two (vectors of) colours in some proportion.

In particular, I'd have an use-case for col_mix() in tidyverse/ggplot2#5833.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions