#[repr(C)]pub struct ColorU {
pub r: u8,
pub g: u8,
pub b: u8,
pub a: u8,
}Expand description
u8-based color, range 0 to 255 (similar to webrenders ColorU)
Fields§
§r: u8§g: u8§b: u8§a: u8Implementations§
Source§impl ColorU
impl ColorU
pub const ALPHA_TRANSPARENT: u8 = 0u8
pub const ALPHA_OPAQUE: u8 = 255u8
pub const RED: ColorU
pub const GREEN: ColorU
pub const BLUE: ColorU
pub const WHITE: ColorU
pub const BLACK: ColorU
pub const TRANSPARENT: ColorU
pub const fn new_rgb(r: u8, g: u8, b: u8) -> Self
pub fn interpolate(&self, other: &Self, t: f32) -> Self
pub const fn has_alpha(&self) -> bool
pub fn to_hash(&self) -> String
pub fn write_hash(&self, f: &mut Formatter<'_>) -> Result
Trait Implementations§
Source§impl Ord for ColorU
impl Ord for ColorU
Source§impl PartialOrd for ColorU
impl PartialOrd for ColorU
impl Copy for ColorU
impl Eq for ColorU
impl StructuralPartialEq for ColorU
Auto Trait Implementations§
impl Freeze for ColorU
impl RefUnwindSafe for ColorU
impl Send for ColorU
impl Sync for ColorU
impl Unpin for ColorU
impl UnwindSafe for ColorU
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