[][src]Struct cichlid::hsv::HSV

pub struct HSV {
    pub h: u8,
    pub s: u8,
    pub v: u8,
}

Represents a color encoded in (hue, saturation, value) format.

This structure is useful for a more human-centered approach to thinking about color.

Fields

h: u8s: u8v: u8

Methods

impl HSV[src]

pub const BLANK: HSV[src]

Blank HSV object where all values are initialized to zero.

pub const fn new(h: u8, s: u8, v: u8) -> Self[src]

Create a new HSV object.

pub fn hue(self) -> u8[src]

Grabs the hue component of the HSV.

pub fn saturation(self) -> u8[src]

Grabs the saturation component of the HSV.

pub fn value(self) -> u8[src]

Grabs the value component of the HSV.

pub fn to_rgb_rainbow(self) -> ColorRGB[src]

Converts hue, saturation, and value to a ColorRGB using a visually balanced rainbow.

pub fn to_rgb_spectrum(self) -> ColorRGB[src]

Converts a HSV to a ColorRGB using a traditional Mathematical rainbow.

pub unsafe fn to_rgb_raw(self) -> ColorRGB[src]

Converts a HSV to a ColorRGB using a traditional Mathematical rainbow.

Safety

Value can only be up to 191, or else undefined behavior will follow.

pub fn maximize_brightness(&mut self)[src]

Changes the brightness (the value component in HSV) to it's maximum, 255.

Trait Implementations

impl Copy for HSV[src]

impl Clone for HSV[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq<HSV> for HSV[src]

impl Eq for HSV[src]

impl Default for HSV[src]

impl From<(u8, u8, u8)> for HSV[src]

impl From<[u8; 3]> for HSV[src]

impl From<HSV> for ColorRGB[src]

impl Display for HSV[src]

impl Hash for HSV[src]

default fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for HSV[src]

Auto Trait Implementations

impl Send for HSV

impl Sync for HSV

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.