pub struct Color { /* private fields */ }Expand description
A color represented by red, green, blue, and alpha channels in the range 0.0 to 1.0.
Implementations§
Source§impl Color
Implements methods for Color.
impl Color
Implements methods for Color.
Sourcepub fn to_css_rgba(&self) -> String
pub fn to_css_rgba(&self) -> String
Sourcepub fn write_css_rgba(&self, buffer: &mut String)
pub fn write_css_rgba(&self, buffer: &mut String)
Writes the CSS rgba() representation into the provided buffer.
Reuses the caller’s allocation so per-frame color conversions in tight
render loops avoid the format! machinery and repeated allocation.
§Arguments
&mut String- The buffer to append the CSS color string to.
Sourcepub fn transparent() -> Color
pub fn transparent() -> Color
Trait Implementations§
impl Copy for Color
Source§impl Interpolable for Color
Implements Interpolable for Color.
impl Interpolable for Color
Implements Interpolable for Color.
Source§impl PartialOrd for Color
impl PartialOrd for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnsafeUnpin for Color
impl UnwindSafe for Color
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