pub struct Gradient {
pub gradient_type: GradientType,
pub rotation: f64,
pub color_stops: Vec<ColorStop>,
}Expand description
Gradient definition for coloring QR code elements.
Fields§
§gradient_type: GradientTypeType of gradient (linear or radial).
rotation: f64Rotation angle in radians (for linear gradients).
color_stops: Vec<ColorStop>Color stops defining the gradient.
Implementations§
Source§impl Gradient
impl Gradient
Sourcepub fn linear_rotated(rotation: f64, color_stops: Vec<ColorStop>) -> Self
pub fn linear_rotated(rotation: f64, color_stops: Vec<ColorStop>) -> Self
Create a new linear gradient with rotation.
Sourcepub fn simple_linear(start: Color, end: Color) -> Self
pub fn simple_linear(start: Color, end: Color) -> Self
Create a simple two-color linear gradient.
Sourcepub fn simple_radial(center: Color, edge: Color) -> Self
pub fn simple_radial(center: Color, edge: Color) -> Self
Create a simple two-color radial gradient.
Trait Implementations§
impl StructuralPartialEq for Gradient
Auto Trait Implementations§
impl Freeze for Gradient
impl RefUnwindSafe for Gradient
impl Send for Gradient
impl Sync for Gradient
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.