[]Struct rltk::HSV

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

Represents an H/S/V triplet, in the range 0..1 (32-bit float)

Fields

h: f32s: f32v: f32

Methods

impl HSV

#[must_use]pub fn new() -> HSV

Constructs a new, zeroed (black) HSV triplet.

#[must_use]pub const fn from_f32(h: f32, s: f32, v: f32) -> HSV

Constructs a new HSV color, from 3 32-bit floats

#[must_use]pub fn to_rgba(&self, alpha: f32) -> RGBA

Converts to an RGBA value with a specified alpha level

#[must_use]pub fn to_rgb(&self) -> RGB

Converts an HSV triple to an RGB triple

#[must_use]pub fn lerp(&self, color: HSV, percent: f32) -> HSV

Trait Implementations

impl Clone for HSV

impl Copy for HSV

impl Debug for HSV

impl Default for HSV

impl From<HSV> for RGB

Support conversion from HSV

impl From<HSV> for RGBA

Support conversion from HSV

impl From<RGB> for HSV

Support conversion from RGB

impl From<RGBA> for HSV

Support conversion from RGBA

impl PartialEq<HSV> for HSV

impl StructuralPartialEq for HSV

Auto Trait Implementations

impl RefUnwindSafe for HSV

impl Send for HSV

impl Sync for HSV

impl Unpin for HSV

impl UnwindSafe for HSV

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,