azul_webrender_api

Struct GradientBuilder

Source
pub struct GradientBuilder { /* private fields */ }
Expand description

Construct a gradient to be used in display lists.

Each gradient needs at least two stops.

Implementations§

Source§

impl GradientBuilder

Source

pub fn new() -> Self

Create a new gradient builder.

Source

pub fn with_stops(stops: Vec<GradientStop>) -> GradientBuilder

Create a gradient builder with a list of stops.

Source

pub fn push(&mut self, stop: GradientStop)

Push an additional stop for the gradient.

Source

pub fn stops(&self) -> &[GradientStop]

Get a reference to the list of stops.

Source

pub fn into_stops(self) -> Vec<GradientStop>

Return the gradient stops vector.

Source

pub fn gradient( &mut self, start_point: LayoutPoint, end_point: LayoutPoint, extend_mode: ExtendMode, ) -> Gradient

Produce a linear gradient, normalize the stops.

Source

pub fn radial_gradient( &mut self, center: LayoutPoint, radius: LayoutSize, extend_mode: ExtendMode, ) -> RadialGradient

Produce a radial gradient, normalize the stops.

Will replace the gradient with a single color if the radius negative.

Source

pub fn conic_gradient( &mut self, center: LayoutPoint, angle: f32, extend_mode: ExtendMode, ) -> ConicGradient

Produce a conic gradient, normalize the stops.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.