Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: expand suite of colour manipulation functions #423

Open
teunbrand opened this issue Apr 12, 2024 · 0 comments · May be fixed by #424
Open

Feature request: expand suite of colour manipulation functions #423

teunbrand opened this issue Apr 12, 2024 · 0 comments · May be fixed by #424

Comments

@teunbrand
Copy link
Contributor

{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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant