pub enum Fill {
Solid(Color),
LinearGradient(LinearGradient),
RadialGradient(RadialGradient),
}Expand description
Describes how to fill vector geometry.
Variants§
Solid(Color)
A single solid color.
LinearGradient(LinearGradient)
A linear gradient.
RadialGradient(RadialGradient)
A radial gradient.
Implementations§
Source§impl Fill
impl Fill
pub fn to_unit_point( (x, y): (Size, Size), (width, height): (f64, f64), ) -> UnitPoint
pub fn to_piet_gradient_stops(stops: Vec<GradientStop>) -> Vec<GradientStop>
Sourcepub fn linearGradient(
start: (Size, Size),
end: (Size, Size),
stops: Vec<GradientStop>,
) -> Fill
pub fn linearGradient( start: (Size, Size), end: (Size, Size), stops: Vec<GradientStop>, ) -> Fill
Constructs a linear gradient fill.
Pax templates should normally use @gradient. When this helper is
needed explicitly, pass start and end as [x, y] lists.
Sourcepub fn with_alpha_factor(&self, factor: f64) -> Fill
pub fn with_alpha_factor(&self, factor: f64) -> Fill
Returns a copy of this fill with alpha multiplied by factor.
Sourcepub fn max_alpha_0_1(&self) -> f64
pub fn max_alpha_0_1(&self) -> f64
Returns the maximum alpha used by this fill.
Sourcepub fn coverage_alpha_0_1(&self) -> f64
pub fn coverage_alpha_0_1(&self) -> f64
Estimates the alpha coverage contributed by this fill.
Trait Implementations§
Source§impl CoercionRules for Fill
impl CoercionRules for Fill
Source§impl<'de> Deserialize<'de> for Fill
impl<'de> Deserialize<'de> for Fill
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl HelperFunctions for Fill
impl HelperFunctions for Fill
Source§fn register_all_functions()
fn register_all_functions()
Registers all helper functions for this type.
Source§impl Interpolatable for Fill
impl Interpolatable for Fill
Source§fn interpolate(&self, _other: &Self, _t: f64) -> Self
fn interpolate(&self, _other: &Self, _t: f64) -> Self
impl StructuralPartialEq for Fill
Source§impl ToPaxValue for Fill
impl ToPaxValue for Fill
Source§fn to_pax_value(self) -> PaxValue
fn to_pax_value(self) -> PaxValue
Converts this value into a
PaxValue.Auto Trait Implementations§
impl Freeze for Fill
impl RefUnwindSafe for Fill
impl Send for Fill
impl Sync for Fill
impl Unpin for Fill
impl UnsafeUnpin for Fill
impl UnwindSafe for Fill
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> PropertyValue for T
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.