pub struct Hsva {
pub h: f32,
pub s: f32,
pub v: f32,
pub a: f32,
}
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§
source§impl Hsva
impl Hsva
pub fn new(h: f32, s: f32, v: f32, a: f32) -> Hsva
sourcepub fn from_srgba_premultiplied(_: [u8; 4]) -> Hsva
pub fn from_srgba_premultiplied(_: [u8; 4]) -> Hsva
From sRGBA
with premultiplied alpha
sourcepub fn from_srgba_unmultiplied(_: [u8; 4]) -> Hsva
pub fn from_srgba_unmultiplied(_: [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_additive_srgb(_: [u8; 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]
To linear space rgba in 0-1 range.
Represents additive colors using a negative alpha.
pub fn to_srgba_premultiplied(&self) -> [u8; 4]
sourcepub fn to_srgba_unmultiplied(&self) -> [u8; 4]
pub fn to_srgba_unmultiplied(&self) -> [u8; 4]
To gamma-space 0-255.
Trait Implementations§
source§impl ColorInterop for Hsva
impl ColorInterop for Hsva
source§impl PartialEq for Hsva
impl PartialEq for Hsva
impl Copy for Hsva
impl StructuralPartialEq for Hsva
Auto Trait Implementations§
impl Freeze for Hsva
impl RefUnwindSafe for Hsva
impl Send for Hsva
impl Sync for Hsva
impl Unpin for Hsva
impl UnwindSafe for Hsva
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more