pub struct Gradient {
pub shape: GradientShape,
/* private fields */
}Expand description
Colors that blend into each other across a widget’s box, drawn over its background with the same corners.
use crabshell_ui::{Color, Gradient, Style};
const DUSK: Style = Style::new().gradient(
Gradient::linear(90.0, Color::hex("#1e1e2e"), Color::hex("#45475a"))
.stop(0.5, Color::hex("#313244")),
);Fields§
§shape: GradientShapeWhich way the colors run.
Implementations§
Source§impl Gradient
impl Gradient
Sourcepub const fn linear(angle: f32, from: Color, to: Color) -> Gradient
pub const fn linear(angle: f32, from: Color, to: Color) -> Gradient
A gradient from from to to along a line at angle degrees: 0
runs from the bottom up, 90 from left to right.
Sourcepub const fn radial(from: Color, to: Color) -> Gradient
pub const fn radial(from: Color, to: Color) -> Gradient
A gradient from from in the middle to to at the farthest corner.
Trait Implementations§
impl Copy for Gradient
impl StructuralPartialEq for Gradient
Auto Trait Implementations§
impl Forget for Gradient
impl Freeze for Gradient
impl Move for Gradient
impl RefUnwindSafe for Gradient
impl Send for Gradient
impl Sync for Gradient
impl Unpin for Gradient
impl UnsafeUnpin for Gradient
impl UnwindSafe for Gradient
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