pub struct Color { /* private fields */ }
Implementations
sourceimpl Color
impl Color
pub const fn black(space: ColorSpace) -> Color
pub const fn white(space: ColorSpace) -> Color
pub const fn from_rgb(r: f32, g: f32, b: f32) -> Color
pub const fn from_rgba(r: f32, g: f32, b: f32, a: f32) -> Color
pub const fn from_hsl(h: f32, s: f32, l: f32) -> Color
pub const fn from_hsla(h: f32, s: f32, l: f32, a: f32) -> Color
pub const fn from_hsv(h: f32, s: f32, v: f32) -> Color
pub const fn from_hsva(h: f32, s: f32, v: f32, a: f32) -> Color
pub const fn from_lab(l: f32, a: f32, b: f32) -> Color
pub const fn from_laba(l: f32, a: f32, b: f32, alpha: f32) -> Color
pub fn with_alpha(self, alpha: f32) -> Color
pub fn opaque(self) -> Color
pub fn transparent(self) -> Color
pub fn check_alpha(self) -> Option<f32>
pub fn alpha(&self) -> f32
pub fn as_bytes(self) -> [u8; 4]
pub fn components_3(&self) -> &[f32; 3]
pub fn components_3_mut(&mut self) -> &mut [f32; 3]
pub fn components_4(&self) -> &[f32; 4]
pub fn components_4_mut(&mut self) -> &mut [f32; 4]
sourcepub fn convert(&mut self, space: ColorSpace)
pub fn convert(&mut self, space: ColorSpace)
Converts this Color into a different ColorSpace in-place.
pub fn to_rgb(&self) -> Color
pub fn to_hsv(&self) -> Color
pub fn to_hsl(&self) -> Color
pub fn to_lab(&self) -> Color
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Color
impl<'de> Deserialize<'de> for Color
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Color
impl StructuralPartialEq 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more