Struct orbtk_utils::Color
source · [−]#[repr(packed)]pub struct Color {
pub data: u32,
}
Expand description
A r g b a color.
Fields
data: u32
Implementations
sourceimpl Color
impl Color
sourcepub fn hsv(h: f64, s: f64, v: f64) -> Self
pub fn hsv(h: f64, s: f64, v: f64) -> Self
Create a new color from HSV(0.0-360.0, 0.0-1.0, 0.0-1.0)
sourcepub fn hsl(h: f64, s: f64, l: f64) -> Self
pub fn hsl(h: f64, s: f64, l: f64) -> Self
Create a new color from HSL(0.0-360.0, 0.0-1.0, 0.0-1.0)
sourcepub const fn rgba(r: u8, g: u8, b: u8, a: u8) -> Self
pub const fn rgba(r: u8, g: u8, b: u8, a: u8) -> Self
Create a new color from RGB and alpha values
sourcepub fn hsva(hue: f64, saturation: f64, value: f64, alpha: f64) -> Self
pub fn hsva(hue: f64, saturation: f64, value: f64, alpha: f64) -> Self
Create a new color from HSV(0.0-360.0, 0.0-1.0, 0.0-1.0) and alpha values(0.0-1.0)
sourcepub fn hsla(hue: f64, saturation: f64, lightness: f64, alpha: f64) -> Self
pub fn hsla(hue: f64, saturation: f64, lightness: f64, alpha: f64) -> Self
Create a new color from HSL(0.0-360.0, 0.0-1.0, 0.0-1.0) and alpha values(0.0-1.0)
Trait Implementations
sourceimpl From<Color> for GradientStop
impl From<Color> for GradientStop
sourceimpl PartialOrd<Color> for Color
impl PartialOrd<Color> for Color
sourcefn partial_cmp(&self, other: &Color) -> Option<Ordering>
fn partial_cmp(&self, other: &Color) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy 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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more