Struct Hsv
Source pub struct Hsv {
pub hue: f32,
pub saturation: f32,
pub value: f32,
pub alpha: f32,
}
Expand description
An colour represented as Hue, Saturation, and Value expressed in the sRGB colour space.
The components are:
- Hue - a number between 0.0 and 360.0
- Saturation - a number between 0.0 and 100.0
- Value / Brightness - a number between 0.0 and 100.0
- Alpha - a number between 0.0 and 100.0
Performs copy-assignment from
source.
Read more
Formats the value using the given formatter.
Read more
Formats the value using the given formatter.
Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Returns a number between 0.0 (fully transparent) to 100.0 (fully opaque).
Returns true if the alpha of this colour is 100.0
Returns true if the alpha of this colour is 0.0
The type returned in the event of a conversion error.
Performs the conversion.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more
Compares
self to
other via
delta_e, checking that the result is less than or equal
to
tolerance.
Read more
Compares
self to
other via
delta_e, checking that the result is greater than or
equal to
tolerance.
Read more
This uses the CIEDE2000 Delta E formula difference between
self and
other.
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
Converts the given value to a
String.
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.
Calculate the contrast ratio between
self and
other. colors according to WCAG 2.1. Returns a value between
1:1 and 21:1
Read more
Get the WCAG level for the contrast between
self and
other.
Read more
Find the closest color that meets a specific WCAG level against a background.
Read more