[−][src]Struct cichlid::hsv::HSV
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: u8
s: u8
v: 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 Eq for HSV
[src]
impl Copy for HSV
[src]
impl PartialEq<HSV> for HSV
[src]
impl Clone for HSV
[src]
fn clone(&self) -> HSV
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
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 Debug for HSV
[src]
impl Hash for HSV
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
default fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Display for HSV
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,