pub struct Swatch {
pub base: Option<Base>,
pub alpha: f32,
}Expand description
A palette color: one of the 16 Base slots, dimmed by an alpha
multiplier. base == None resolves to a fully transparent color (the
canvas’s “draw nothing” color). This is the single color type at the
Renderer interface — it keeps the API tied to
the palette instead of letting arbitrary Colors proliferate. Construct a
fully-opaque swatch from a Base via Base.into(); use Swatch::faded
for an overlay tint and Swatch::TRANSPARENT for nothing.
Fields§
§base: Option<Base>§alpha: f32Implementations§
Trait Implementations§
impl Copy for Swatch
impl StructuralPartialEq for Swatch
Auto Trait Implementations§
impl Freeze for Swatch
impl RefUnwindSafe for Swatch
impl Send for Swatch
impl Sync for Swatch
impl Unpin for Swatch
impl UnsafeUnpin for Swatch
impl UnwindSafe for Swatch
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