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