pub enum Brush {
Solid(Color),
LinearGradient {
colors: Vec<Color>,
stops: Option<Vec<f32>>,
start: Point,
end: Point,
tile_mode: TileMode,
},
RadialGradient {
colors: Vec<Color>,
stops: Option<Vec<f32>>,
center: Point,
radius: f32,
tile_mode: TileMode,
},
SweepGradient {
colors: Vec<Color>,
stops: Option<Vec<f32>>,
center: Point,
},
}Variants§
Implementations§
Source§impl Brush
impl Brush
pub fn solid(color: Color) -> Self
Sourcepub fn linear_gradient(colors: Vec<Color>) -> Self
pub fn linear_gradient(colors: Vec<Color>) -> Self
Creates a linear gradient that defaults to Compose semantics:
start at (0,0), end at (+inf,+inf), and TileMode::Clamp.
pub fn linear_gradient_range( colors: Vec<Color>, start: Point, end: Point, ) -> Self
pub fn linear_gradient_with_tile_mode( colors: Vec<Color>, start: Point, end: Point, tile_mode: TileMode, ) -> Self
pub fn linear_gradient_stops( color_stops: Vec<(f32, Color)>, start: Point, end: Point, tile_mode: TileMode, ) -> Self
pub fn vertical_gradient(colors: Vec<Color>, start_y: f32, end_y: f32) -> Self
pub fn vertical_gradient_tiled( colors: Vec<Color>, start_y: f32, end_y: f32, tile_mode: TileMode, ) -> Self
pub fn vertical_gradient_default(colors: Vec<Color>) -> Self
pub fn vertical_gradient_stops( color_stops: Vec<(f32, Color)>, start_y: f32, end_y: f32, tile_mode: TileMode, ) -> Self
pub fn horizontal_gradient(colors: Vec<Color>, start_x: f32, end_x: f32) -> Self
pub fn horizontal_gradient_tiled( colors: Vec<Color>, start_x: f32, end_x: f32, tile_mode: TileMode, ) -> Self
pub fn horizontal_gradient_default(colors: Vec<Color>) -> Self
pub fn horizontal_gradient_stops( color_stops: Vec<(f32, Color)>, start_x: f32, end_x: f32, tile_mode: TileMode, ) -> Self
pub fn radial_gradient(colors: Vec<Color>, center: Point, radius: f32) -> Self
pub fn radial_gradient_tiled( colors: Vec<Color>, center: Point, radius: f32, tile_mode: TileMode, ) -> Self
pub fn radial_gradient_stops( color_stops: Vec<(f32, Color)>, center: Point, radius: f32, tile_mode: TileMode, ) -> Self
pub fn sweep_gradient(colors: Vec<Color>, center: Point) -> Self
pub fn sweep_gradient_stops( color_stops: Vec<(f32, Color)>, center: Point, ) -> Self
Trait Implementations§
Source§impl RenderHash for Brush
impl RenderHash for Brush
fn render_hash(&self) -> u64
impl StructuralPartialEq for Brush
Auto Trait Implementations§
impl Freeze for Brush
impl RefUnwindSafe for Brush
impl Send for Brush
impl Sync for Brush
impl Unpin for Brush
impl UnsafeUnpin for Brush
impl UnwindSafe for Brush
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more