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

Represents an H/S/V triplet, in the range 0..1 (32-bit float) This can provide for a more natural color progression, and provides compatibility with HSV-based color systems.

Fields

h: f32

Hue (range 0..1)

s: f32

Saturation (range 0..1)

v: f32

Value (range 0..1)

Implementations

Constructs a new, zeroed (black) HSV triplet.

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

Arguments
  • h - The hue (0..1) to use.
  • s - The saturation (0..1) to use.
  • v - The value (0..1) to use.

Converts to an RGBA value with a specified alpha level

Converts an HSV triple to an RGB triple

Progress smoothly between two colors, in the HSV color space.

Arguments
  • color - the target color.
  • percent - the percentage (0..1) of the starting (self) and target color to use.
Example
use bracket_color::prelude::*;
let red = RGB::named(RED);
let blue = RGB::named(YELLOW);
let color = red.lerp(blue, 0.5);

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Support conversion from HSV

Converts to this type from the input type.

Support conversion from HSV

Converts to this type from the input type.

Support conversion from RGB

Converts to this type from the input type.

Support conversion from RGBA

Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.