Enum sixtyfps_corelib::Brush [−][src]
#[repr(C)] #[non_exhaustive] pub enum Brush { SolidColor(Color), LinearGradient(LinearGradientBrush), }
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)
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
SolidColor(Color)
The color variant of brush is a plain color that is to be used for the fill.
LinearGradient(LinearGradientBrush)
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
[src]
impl Brush
[src]pub fn color(&self) -> Color
[src]
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
[src]
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
impl From<LinearGradientBrush> for Brush
[src]
impl From<LinearGradientBrush> for Brush
[src]fn from(original: LinearGradientBrush) -> Brush
[src]
impl InterpolatedPropertyValue for Brush
[src]
impl InterpolatedPropertyValue for Brush
[src]fn interpolate(&self, target_value: &Self, t: f32) -> Self
[src]
impl StructuralPartialEq for Brush
[src]
impl StructuralPartialEq for Brush
[src]Auto Trait Implementations
impl RefUnwindSafe for Brush
impl RefUnwindSafe for Brush
impl UnwindSafe for Brush
impl UnwindSafe for Brush