Closed ijlyttle closed 4 years ago
Given hue_0
and hue_1
, return a function that takes luminance, returns hue.
Given a collection of LC (lumanance-chroma) control points, and a hue-luminance function, return an hcl data-frame.
Maybe something like:
hl_surface <- function(range_hue) {
# validation for range_hue
function(lum) {
hue <- range_hue[1] + lum / 100 * (range_hue[2] - range_hue[1])
hue %% 360
}
}
df_hcl <- function(df_cl, hl_surface) {
tibble::tibble(
h = hl_surface(df_cl[["l"]]),
c = df_cl[["c"]],
l = df_cl[["l"]]
)
}
One thing coming into focus for me is that continuous palettes are driven by luminance.
Let's say that we can define a surface in HCL space as the collection of points where
Let's postulate that a family of palettes, lets say "blues", can be defined as being drawn along such a surface defined using
hue_0
andhue_1
.To specify a palette function, we need would only specify control points using luminance and chroma.
To get the entire set of control points, we would need to calculate the hue, given the luminance, for the family.