pub type Gradient = GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>;
Expand description
Computed values for a CSS gradient. https://drafts.csswg.org/css-images/#gradients
Aliased Type§
enum Gradient {
Linear {
direction: LineDirection,
color_interpolation_method: ColorInterpolationMethod,
items: OwnedSlice<GenericGradientItem<GenericColor<Percentage>, LengthPercentage>>,
flags: GradientFlags,
compat_mode: GradientCompatMode,
},
Radial {
shape: GenericEndingShape<NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>>,
position: GenericPosition<LengthPercentage, LengthPercentage>,
color_interpolation_method: ColorInterpolationMethod,
items: OwnedSlice<GenericGradientItem<GenericColor<Percentage>, LengthPercentage>>,
flags: GradientFlags,
compat_mode: GradientCompatMode,
},
Conic {
angle: Angle,
position: GenericPosition<LengthPercentage, LengthPercentage>,
color_interpolation_method: ColorInterpolationMethod,
items: OwnedSlice<GenericGradientItem<GenericColor<Percentage>, AngleOrPercentage>>,
flags: GradientFlags,
},
}
Variants§
Linear
A linear gradient.
Fields
§
direction: LineDirection
Line direction
§
color_interpolation_method: ColorInterpolationMethod
Method to use for color interpolation.
§
items: OwnedSlice<GenericGradientItem<GenericColor<Percentage>, LengthPercentage>>
The color stops and interpolation hints.
§
flags: GradientFlags
State flags for the gradient.
§
compat_mode: GradientCompatMode
Compatibility mode.
Radial
A radial gradient.
Fields
§
shape: GenericEndingShape<NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>>
Shape of gradient
§
position: GenericPosition<LengthPercentage, LengthPercentage>
Center of gradient
§
color_interpolation_method: ColorInterpolationMethod
Method to use for color interpolation.
§
items: OwnedSlice<GenericGradientItem<GenericColor<Percentage>, LengthPercentage>>
The color stops and interpolation hints.
§
flags: GradientFlags
State flags for the gradient.
§
compat_mode: GradientCompatMode
Compatibility mode.
Conic
A conic gradient.
Fields
§
position: GenericPosition<LengthPercentage, LengthPercentage>
Center of gradient
§
color_interpolation_method: ColorInterpolationMethod
Method to use for color interpolation.
§
items: OwnedSlice<GenericGradientItem<GenericColor<Percentage>, AngleOrPercentage>>
The color stops and interpolation hints.
§
flags: GradientFlags
State flags for the gradient.
Trait Implementations
Source§impl<LineDirection: Clone, LengthPercentage: Clone, NonNegativeLength: Clone, NonNegativeLengthPercentage: Clone, Position: Clone, Angle: Clone, AngleOrPercentage: Clone, Color: Clone> Clone for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
impl<LineDirection: Clone, LengthPercentage: Clone, NonNegativeLength: Clone, NonNegativeLengthPercentage: Clone, Position: Clone, Angle: Clone, AngleOrPercentage: Clone, Color: Clone> Clone for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
Source§fn clone(
&self,
) -> GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
fn clone( &self, ) -> GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<LineDirection: Debug, LengthPercentage: Debug, NonNegativeLength: Debug, NonNegativeLengthPercentage: Debug, Position: Debug, Angle: Debug, AngleOrPercentage: Debug, Color: Debug> Debug for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
impl<LineDirection: Debug, LengthPercentage: Debug, NonNegativeLength: Debug, NonNegativeLengthPercentage: Debug, Position: Debug, Angle: Debug, AngleOrPercentage: Debug, Color: Debug> Debug for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
Source§impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> MallocSizeOf for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where
LineDirection: MallocSizeOf,
LengthPercentage: MallocSizeOf,
NonNegativeLength: MallocSizeOf,
NonNegativeLengthPercentage: MallocSizeOf,
Position: MallocSizeOf,
Angle: MallocSizeOf,
AngleOrPercentage: MallocSizeOf,
Color: MallocSizeOf,
impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> MallocSizeOf for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where
LineDirection: MallocSizeOf,
LengthPercentage: MallocSizeOf,
NonNegativeLength: MallocSizeOf,
NonNegativeLengthPercentage: MallocSizeOf,
Position: MallocSizeOf,
Angle: MallocSizeOf,
AngleOrPercentage: MallocSizeOf,
Color: MallocSizeOf,
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Source§impl<LineDirection: PartialEq, LengthPercentage: PartialEq, NonNegativeLength: PartialEq, NonNegativeLengthPercentage: PartialEq, Position: PartialEq, Angle: PartialEq, AngleOrPercentage: PartialEq, Color: PartialEq> PartialEq for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
impl<LineDirection: PartialEq, LengthPercentage: PartialEq, NonNegativeLength: PartialEq, NonNegativeLengthPercentage: PartialEq, Position: PartialEq, Angle: PartialEq, AngleOrPercentage: PartialEq, Color: PartialEq> PartialEq for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
Source§fn eq(
&self,
other: &GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>,
) -> bool
fn eq( &self, other: &GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>, ) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> ToComputedValue for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where
LineDirection: ToComputedValue,
LengthPercentage: ToComputedValue,
NonNegativeLength: ToComputedValue,
NonNegativeLengthPercentage: ToComputedValue,
Position: ToComputedValue,
Angle: ToComputedValue,
AngleOrPercentage: ToComputedValue,
Color: ToComputedValue,
impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> ToComputedValue for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where
LineDirection: ToComputedValue,
LengthPercentage: ToComputedValue,
NonNegativeLength: ToComputedValue,
NonNegativeLengthPercentage: ToComputedValue,
Position: ToComputedValue,
Angle: ToComputedValue,
AngleOrPercentage: ToComputedValue,
Color: ToComputedValue,
Source§type ComputedValue = GenericGradient<<LineDirection as ToComputedValue>::ComputedValue, <LengthPercentage as ToComputedValue>::ComputedValue, <NonNegativeLength as ToComputedValue>::ComputedValue, <NonNegativeLengthPercentage as ToComputedValue>::ComputedValue, <Position as ToComputedValue>::ComputedValue, <Angle as ToComputedValue>::ComputedValue, <AngleOrPercentage as ToComputedValue>::ComputedValue, <Color as ToComputedValue>::ComputedValue>
type ComputedValue = GenericGradient<<LineDirection as ToComputedValue>::ComputedValue, <LengthPercentage as ToComputedValue>::ComputedValue, <NonNegativeLength as ToComputedValue>::ComputedValue, <NonNegativeLengthPercentage as ToComputedValue>::ComputedValue, <Position as ToComputedValue>::ComputedValue, <Angle as ToComputedValue>::ComputedValue, <AngleOrPercentage as ToComputedValue>::ComputedValue, <Color as ToComputedValue>::ComputedValue>
The computed value type we’re going to be converted to.
Source§fn from_computed_value(from: &Self::ComputedValue) -> Self
fn from_computed_value(from: &Self::ComputedValue) -> Self
Convert a computed value to specified value form. Read more
Source§fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
Convert a specified value to a computed value, using itself and the data
inside the
Context
.Source§impl<D, LP, NL, NLP, P, A, AoP, C> ToCss for Gradient<D, LP, NL, NLP, P, A, AoP, C>where
D: LineDirection,
LP: ToCss,
NL: ToCss,
NLP: ToCss,
P: PositionComponent + ToCss,
A: ToCss + Zero,
AoP: ToCss,
C: ToCss,
impl<D, LP, NL, NLP, P, A, AoP, C> ToCss for Gradient<D, LP, NL, NLP, P, A, AoP, C>where
D: LineDirection,
LP: ToCss,
NL: ToCss,
NLP: ToCss,
P: PositionComponent + ToCss,
A: ToCss + Zero,
AoP: ToCss,
C: ToCss,
Source§impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> ToResolvedValue for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where
LineDirection: ToResolvedValue,
LengthPercentage: ToResolvedValue,
NonNegativeLength: ToResolvedValue,
NonNegativeLengthPercentage: ToResolvedValue,
Position: ToResolvedValue,
Angle: ToResolvedValue,
AngleOrPercentage: ToResolvedValue,
Color: ToResolvedValue,
impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> ToResolvedValue for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where
LineDirection: ToResolvedValue,
LengthPercentage: ToResolvedValue,
NonNegativeLength: ToResolvedValue,
NonNegativeLengthPercentage: ToResolvedValue,
Position: ToResolvedValue,
Angle: ToResolvedValue,
AngleOrPercentage: ToResolvedValue,
Color: ToResolvedValue,
Source§type ResolvedValue = GenericGradient<<LineDirection as ToResolvedValue>::ResolvedValue, <LengthPercentage as ToResolvedValue>::ResolvedValue, <NonNegativeLength as ToResolvedValue>::ResolvedValue, <NonNegativeLengthPercentage as ToResolvedValue>::ResolvedValue, <Position as ToResolvedValue>::ResolvedValue, <Angle as ToResolvedValue>::ResolvedValue, <AngleOrPercentage as ToResolvedValue>::ResolvedValue, <Color as ToResolvedValue>::ResolvedValue>
type ResolvedValue = GenericGradient<<LineDirection as ToResolvedValue>::ResolvedValue, <LengthPercentage as ToResolvedValue>::ResolvedValue, <NonNegativeLength as ToResolvedValue>::ResolvedValue, <NonNegativeLengthPercentage as ToResolvedValue>::ResolvedValue, <Position as ToResolvedValue>::ResolvedValue, <Angle as ToResolvedValue>::ResolvedValue, <AngleOrPercentage as ToResolvedValue>::ResolvedValue, <Color as ToResolvedValue>::ResolvedValue>
The resolved value type we’re going to be converted to.
Source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Convert a resolved value to resolved value form.
Source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Convert a resolved value to a resolved value.