[−][src]Enum conrod_core::color::Color
Color supporting RGB and HSL variants.
Variants
Red, Green, Blue, Alpha - All values' scales represented between 0.0 and 1.0.
Hue, Saturation, Lightness, Alpha - all values scales represented between 0.0 and 1.0.
Implementations
impl Color
[src]
pub fn complement(self) -> Color
[src]
Produce a complementary color. The two colors will accent each other. This is the same as rotating the hue by 180 degrees.
pub fn luminance(&self) -> f32
[src]
Calculate and return the luminance of the Color.
pub fn plain_contrast(self) -> Color
[src]
Return either black or white, depending which contrasts the Color the most. This will be useful for determining a readable color for text on any given background Color.
pub fn to_hsl(self) -> Hsla
[src]
Extract the components of a color in the HSL format.
pub fn to_rgb(self) -> Rgba
[src]
Extract the components of a color in the RGB format.
pub fn to_fsa(self) -> [f32; 4]
[src]
Extract the components of a color in the RGB format within a fixed-size array.
pub fn to_byte_fsa(self) -> [u8; 4]
[src]
Same as to_fsa
, except r, g, b and a are represented in byte form.
pub fn with_luminance(self, l: f32) -> Color
[src]
Return the same color but with the given luminance.
pub fn alpha(self, alpha: f32) -> Color
[src]
Return the same color but with the alpha multiplied by the given alpha.
pub fn with_alpha(self, a: f32) -> Color
[src]
Return the same color but with the given alpha.
pub fn highlighted(self) -> Color
[src]
Return a highlighted version of the current Color.
pub fn clicked(&self) -> Color
[src]
Return a clicked version of the current Color.
pub fn invert(self) -> Color
[src]
Return the Color's invert.
pub fn red(&self) -> f32
[src]
Return the red value.
pub fn green(&self) -> f32
[src]
Return the green value.
pub fn blue(&self) -> f32
[src]
Return the blue value.
pub fn set_red(&mut self, r: f32)
[src]
Set the red value.
pub fn set_green(&mut self, g: f32)
[src]
Set the green value.
pub fn set_blue(&mut self, b: f32)
[src]
Set the blue value.
Trait Implementations
impl Clone for Color
[src]
impl Copy for Color
[src]
impl Debug for Color
[src]
impl From<Color> for Hsla
[src]
impl From<Color> for Rgba
[src]
impl From<Hsla> for Color
[src]
impl From<Rgba> for Color
[src]
impl PartialEq<Color> for Color
[src]
impl StructuralPartialEq for Color
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Style for T where
T: Any + Debug + PartialEq<T>,
[src]
T: Any + Debug + PartialEq<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,