ijlyttle / colorpath

Build Color Paths
https://ijlyttle.github.io/colorpath
Other
0 stars 0 forks source link

luminance rescaler #11

Closed ijlyttle closed 4 years ago

ijlyttle commented 4 years ago

Change the names and the arguments to make a smoother introduction to a luminance rescaler.

# linear input-rescaler, maps c(0, 1) to `range`
rescaler_linear_input <- function(range) # returns cpath_rescaler
# linear luminance-rescaler, maps c(0, 1) to luminance `range` for `palette`
rescaler_linear_luminance <- function(range, palette) # returns cpath_rescaler

I think it's a bit clunky to have to specify a palette twice to rescale it; provides an opportunity to make a mistake.

In the future, consider a wrapper function.