A representation of a partial ramp between two colours: the origin colour
(from) and the distance from the origin colour to the target colour
(amount, a value between 0 and 1). The target colour of the ramp
can be filled in later using ramp_colours(), producing a colour.
Usage
partial_colour_ramp(amount = double(), from = "white")
Value
A vctrs::rcrd of class "ggdist_partial_colour_ramp" with fields
"amount" and "from".
Arguments
amount
Numeric vector between 0 and 1 giving amounts to ramp
the colour. 0 corresponds to the colour from.
from
Character vector giving colours to ramp from.
Author
Matthew Kay
Details
This datatype is used by scale_colour_ramp to create ramped colours in
ggdist geoms. It is a vctrs::rcrd datatype with two fields:
"amount", the amount to ramp, and "from", the colour to ramp from.
Colour ramps can be applied (i.e. translated into colours) using
ramp_colours(), which can be used with partial_colour_ramp()
to implement geoms that make use of colour_ramp or fill_ramp scales.
See Also
Other colour ramp functions:
guide_rampbar(),
ramp_colours(),
scale_colour_ramp