Enum sixtyfps::Brush [−]
#[repr(C)]
#[non_exhaustive]
pub enum Brush {
SolidColor(Color),
LinearGradient(LinearGradientBrush),
}
Expand description
A brush is a data structure that is used to describe how a shape, such as a rectangle, path or even text, shall be filled. A brush can also be applied to the outline of a shape, that means the fill of the outline itself.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
SolidColor(Color)
The color variant of brush is a plain color that is to be used for the fill.
Tuple Fields of SolidColor
0: Color
The linear gradient variant of a brush describes the gradient stops for a fill where all color stops are along a line that’s rotated by the specified angle.
Implementations
impl Brush
impl Brush
If the brush is SolidColor, the contained color is returned. If the brush is a LinearGradient, the color of the first stop is returned.
pub fn is_transparent(&self) -> bool
pub fn is_transparent(&self) -> bool
Returns true if this brush contains a fully transparent color (alpha value is zero)
assert!(Brush::default().is_transparent());
assert!(Brush::SolidColor(Color::from_argb_u8(0, 255, 128, 140)).is_transparent());
assert!(!Brush::SolidColor(Color::from_argb_u8(25, 128, 140, 210)).is_transparent());
Trait Implementations
Construct a brush with transparent color
impl InterpolatedPropertyValue for Brush
impl InterpolatedPropertyValue for Brush
pub fn interpolate(&self, target_value: &Brush, t: f32) -> Brush
pub fn interpolate(&self, target_value: &Brush, t: f32) -> Brush
Returns the interpolated value between self and target_value according to the progress parameter t that’s usually between 0 and 1. With certain animation easing curves it may over- or undershoot though. Read more
impl StructuralPartialEq for Brush
Auto Trait Implementations
impl RefUnwindSafe for Brush
impl UnwindSafe for Brush
Blanket Implementations
Mutably borrows from an owned value. Read more