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) -> Brush
Sourcepub fn linear_gradient(colors: Vec<Color>) -> Brush
pub fn linear_gradient(colors: Vec<Color>) -> Brush
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, ) -> Brush
pub fn linear_gradient_with_tile_mode( colors: Vec<Color>, start: Point, end: Point, tile_mode: TileMode, ) -> Brush
pub fn linear_gradient_stops( color_stops: Vec<(f32, Color)>, start: Point, end: Point, tile_mode: TileMode, ) -> Brush
pub fn vertical_gradient(colors: Vec<Color>, start_y: f32, end_y: f32) -> Brush
pub fn vertical_gradient_tiled( colors: Vec<Color>, start_y: f32, end_y: f32, tile_mode: TileMode, ) -> Brush
pub fn vertical_gradient_default(colors: Vec<Color>) -> Brush
pub fn vertical_gradient_stops( color_stops: Vec<(f32, Color)>, start_y: f32, end_y: f32, tile_mode: TileMode, ) -> Brush
pub fn horizontal_gradient( colors: Vec<Color>, start_x: f32, end_x: f32, ) -> Brush
pub fn horizontal_gradient_tiled( colors: Vec<Color>, start_x: f32, end_x: f32, tile_mode: TileMode, ) -> Brush
pub fn horizontal_gradient_default(colors: Vec<Color>) -> Brush
pub fn horizontal_gradient_stops( color_stops: Vec<(f32, Color)>, start_x: f32, end_x: f32, tile_mode: TileMode, ) -> Brush
pub fn radial_gradient(colors: Vec<Color>, center: Point, radius: f32) -> Brush
pub fn radial_gradient_tiled( colors: Vec<Color>, center: Point, radius: f32, tile_mode: TileMode, ) -> Brush
pub fn radial_gradient_stops( color_stops: Vec<(f32, Color)>, center: Point, radius: f32, tile_mode: TileMode, ) -> Brush
pub fn sweep_gradient(colors: Vec<Color>, center: Point) -> Brush
pub fn sweep_gradient_stops( color_stops: Vec<(f32, Color)>, center: Point, ) -> Brush
Trait Implementations§
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