[−][src]Enum nannou::ui::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 valuess scales represented between 0.0 and 1.0.
Methods
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 Debug for Color
[src]
impl PartialEq<Color> for Color
[src]
impl Clone for Color
[src]
impl Copy for Color
[src]
impl From<Color> for Rgba
[src]
impl From<Hsla> for Color
[src]
impl From<Color> for Hsla
[src]
impl From<Rgba> for Color
[src]
Auto Trait Implementations
impl Send for Color
impl Unpin for Color
impl Sync for Color
impl UnwindSafe for Color
impl RefUnwindSafe for Color
Blanket Implementations
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Style for T where
T: Any + Debug + PartialEq<T>,
[src]
T: Any + Debug + PartialEq<T>,
impl<T> Content for T
[src]
fn ref_from_ptr(ptr: *mut c_void, size: usize) -> Option<*mut T>
[src]
fn is_size_suitable(size: usize) -> bool
[src]
fn indiv_size() -> usize
[src]
impl<T> SafeBorrow<T> for T
[src]
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,