pub enum Brush<'a> {
Solid {
palette_index: u16,
alpha: f32,
},
LinearGradient {
p0: Point<f32>,
p1: Point<f32>,
color_stops: &'a [ColorStop],
extend: Extend,
},
RadialGradient {
c0: Point<f32>,
r0: f32,
c1: Point<f32>,
r1: f32,
color_stops: &'a [ColorStop],
extend: Extend,
},
SweepGradient {
c0: Point<f32>,
start_angle: f32,
end_angle: f32,
color_stops: &'a [ColorStop],
extend: Extend,
},
}Expand description
A solid color or gradient used to fill a region.
Gradients are normalized. A linear gradient is reduced to two points with its stops between them. Other gradients have their stops in the range 0 to 1, with their geometry adjusted to match.
Variants§
Solid
A solid fill with the color at palette_index, multiplied by alpha.
LinearGradient
A linear gradient from p0 to p1, reduced from the three points in
the table.
With one stop, the fill is the solid color of that stop.
RadialGradient
A radial gradient between two circles.
Normalizing the stops can produce a negative radius. In that case, the color line is truncated where the interpolated radius reaches zero.
SweepGradient
A sweep gradient around c0, with angles in degrees clockwise.
This is the reverse of the direction in the table. Normalizing the stops can move the angles outside 0 to 360. Only that range is drawn.