plushie/prop/gradient
Gradient type for background fills.
Currently supports linear gradients with an angle and a list of color stops. Each stop has an offset (0.0 to 1.0) and a Color value (from prop/color).
Types
pub type Gradient {
Gradient(angle: Float, stops: List(GradientStop))
}
Constructors
-
Gradient(angle: Float, stops: List(GradientStop))
pub type GradientStop {
GradientStop(offset: Float, color: color.Color)
}
Constructors
-
GradientStop(offset: Float, color: color.Color)
Values
pub fn linear(
angle: Float,
stops: List(GradientStop),
) -> Gradient
Create a linear gradient with the given angle and stops.
pub fn to_prop_value(g: Gradient) -> node.PropValue
Encode a Gradient to its wire-format PropValue.