Expand description
Hue, saturation, value, alpha. All in the range [0, 1]. No premultiplied alpha.
Fields
h: f32
hue 0-1
s: f32
saturation 0-1
v: f32
value 0-1
a: f32
alpha 0-1. A negative value signifies an additive color (and alpha is ignored).
Implementations
sourceimpl Hsva
impl Hsva
pub fn new(h: f32, s: f32, v: f32, a: f32) -> Hsva
sourcepub fn from_srgba_premultiplied(srgba: [u8; 4]) -> Hsva
pub fn from_srgba_premultiplied(srgba: [u8; 4]) -> Hsva
From sRGBA
with premultiplied alpha
sourcepub fn from_srgba_unmultiplied(srgba: [u8; 4]) -> Hsva
pub fn from_srgba_unmultiplied(srgba: [u8; 4]) -> Hsva
From sRGBA
without premultiplied alpha
sourcepub fn from_rgba_premultiplied(r: f32, g: f32, b: f32, a: f32) -> Hsva
pub fn from_rgba_premultiplied(r: f32, g: f32, b: f32, a: f32) -> Hsva
From linear RGBA with premultiplied alpha
sourcepub fn from_rgba_unmultiplied(r: f32, g: f32, b: f32, a: f32) -> Hsva
pub fn from_rgba_unmultiplied(r: f32, g: f32, b: f32, a: f32) -> Hsva
From linear RGBA without premultiplied alpha
pub fn from_additive_rgb(rgb: [f32; 3]) -> Hsva
pub fn from_rgb(rgb: [f32; 3]) -> Hsva
pub fn from_srgb([u8; 3]) -> Hsva
pub fn to_opaque(self) -> Hsva
pub fn to_rgb(&self) -> [f32; 3]
pub fn to_srgb(&self) -> [u8; 3]
pub fn to_rgba_premultiplied(&self) -> [f32; 4]
sourcepub fn to_rgba_unmultiplied(&self) -> [f32; 4]
pub fn to_rgba_unmultiplied(&self) -> [f32; 4]
Represents additive colors using a negative alpha.
pub fn to_srgba_premultiplied(&self) -> [u8; 4]
pub fn to_srgba_unmultiplied(&self) -> [u8; 4]
Trait Implementations
impl Copy for Hsva
impl StructuralPartialEq for Hsva
Auto Trait Implementations
impl RefUnwindSafe for Hsva
impl Send for Hsva
impl Sync for Hsva
impl Unpin for Hsva
impl UnwindSafe for Hsva
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more