A continuous-palette function takes a vector of numbers, each between
0 and 1, and returns a vector of character strings, each containing the
correpsonding hex-code. You con use a continuous-palette function to
build a custom ggplot2 scale, using ggplot2::continuous_scale()
.
pev_fcont(.fcont, ...) # S3 method for default pev_fcont(.fcont, ...) # S3 method for pev_fcont pev_fcont(.fcont, ...) # S3 method for character pev_fcont(.fcont, ...) # S3 method for pev_hcl pev_fcont(.fcont, ...)
.fcont |
|
---|---|
... | other arguments (not used). |
function
with S3 class pev_fcont
,
when called with a numeric vector with values between 0 and 1,
returns the corresponding (hex-code) values.
These functions help you build, modify, and compose continuous-palette functions. By working with functions, rather than with a finite set of hex-colors, we can avoid interpolation-errors as we compose and rescale.
A continuous-palette function can be constructed using pev_fcont()
; it takes
a single argument .fcont
, which can be one of:
character
(scalar) name of a palette
, used by colorspace::hcl_palettes, or
(vector) hex-colors, used by scales::colour_ramp()
pev_hcl
Set of HCL parameters returned by pev_hcl()
.
pev_fcont
If you provide a pev_fcont
, this is a no-op.
The print method for a pev_fcont
function generates a plot of the palette.
The other functions that return continuous-palette functions are:
pev_fcont_cvd()
Modify output to simulate color-vision deficiency.
pev_fcont_rescale()
Rescale input to continuous-palette function.
pev_fcont_reverse()
Reverse palette-function.
pev_fcont_diverging()
Create a diverging-palette function from two functions.
# Use a colorspace palette pev_fcont("Blues 2")