pub enum Brush {
Solid(Color),
Linear {
angle_deg: f32,
stops: Arc<[(f32, Color)]>,
},
Radial {
radius: f32,
stops: Arc<[(f32, Color)]>,
},
Conic {
from_deg: f32,
stops: Arc<[(f32, Color)]>,
},
}Expand description
Fill brush for an ExtractedRect. Gradient variants store their stops in an Arc<[...]> so cloning the brush bumps the Arc instead of deep-copying.
PartialEq compares appearance so the retained Node-IR damage diff
(crate::node_ir) can tell an unchanged fill from a changed one - the
producer rebuilds a fresh brush every frame, so identity (Arc::ptr_eq)
alone never matches across frames.
Variants§
Solid(Color)
Solid fill.
Linear
Linear gradient. angle_deg follows the CSS convention (0 = left->right, 90 = bottom->top, 180 = top->bottom); stops are sorted by ascending offset.
Fields
Radial
Radial gradient centred at 50% / 50% of the entity rect.
Fields
Conic
Conic (sweep) gradient centred at 50% / 50%.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Brush
Auto Trait Implementations§
impl Freeze for Brush
impl RefUnwindSafe for Brush
impl Send for Brush
impl Sync for Brush
impl Unpin for Brush
impl UnsafeUnpin for Brush
impl UnwindSafe for Brush
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> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.