pub struct Color(/* private fields */);Implementations§
Source§impl Color
impl Color
pub const TRANSPARENT: Color
pub const BLACK: Color
pub const WHITE: Color
pub fn srgb(red: f32, green: f32, blue: f32) -> Color
pub fn srgba(red: f32, green: f32, blue: f32, alpha: f32) -> Color
pub const fn linear_rgb(red: f32, green: f32, blue: f32) -> Color
pub const fn linear_rgba(red: f32, green: f32, blue: f32, alpha: f32) -> Color
pub fn from_srgb8(red: u8, green: u8, blue: u8) -> Color
pub fn from_srgba8(red: u8, green: u8, blue: u8, alpha: u8) -> Color
pub fn from_hex(value: &str) -> Result<Color, ParseColorError>
pub const fn to_linear_rgba(self) -> [f32; 4]
pub fn to_srgba(self) -> [f32; 4]
pub fn to_srgba8(self) -> [u8; 4]
pub const fn with_alpha(self, alpha: f32) -> Color
pub fn mix( self, target: Color, progress: f32, space: ColorInterpolation, ) -> Color
pub fn to_interpolation_components(self, space: ColorInterpolation) -> [f32; 4]
pub fn from_interpolation_components( components: [f32; 4], space: ColorInterpolation, ) -> Color
pub fn relative_luminance(self) -> f32
pub fn contrast_ratio(self, other: Color) -> f32
Trait Implementations§
impl Copy 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