pub struct Color { /* private fields */ }
Expand description
This structure represents a color value in the standard RGB color model, comprised of red, blue, green, and transparency components.
Implementations§
source§impl Color
impl Color
sourcepub const fn new(color: u32) -> Color
pub const fn new(color: u32) -> Color
Creates a new Color
structure from a 4 bytes ARGB representation.
sourcepub fn set_transparency(&mut self, alpha: u8)
pub fn set_transparency(&mut self, alpha: u8)
Sets the transparency of the color, in which 0
is opaque and 0xFF
is transparent.
sourcepub fn transparency(&self) -> u8
pub fn transparency(&self) -> u8
Returns the transparency component of this Color
as a u8
value.
Trait Implementations§
source§impl PartialEq<Color> for Color
impl PartialEq<Color> for Color
impl Copy for Color
impl Eq for Color
Auto Trait Implementations§
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin 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