Skip to content

Conversation

@teunbrand
Copy link
Contributor

This PR aims to fix #423.

Briefly, it adds 5 new functions demonstrated below:

devtools::load_all("~/packages/scales/")
#> ℹ Loading scales

x <- rainbow(9)
show_col(col_shift(x, 90))

show_col(col_saturate(x, -50))

show_col(col_darker(x, 20))

show_col(col_lighter(x, 20))

show_col(col_mix(x, "limegreen"))

Created on 2024-04-14 with reprex v2.1.0

I'm not 100% sure that HSL space is the 'best' space for lighter/darker/saturate, but it works well enough I think.

Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomasp85 thomasp85 merged commit 68aed0e into r-lib:main Sep 13, 2024
@teunbrand teunbrand deleted the colour_functions branch September 13, 2024 06:54
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 this pull request may close these issues.

Feature request: expand suite of colour manipulation functions

2 participants