#[repr(C)]pub struct Hsla<T>where
T: ColorComponent,{
pub h: T,
pub s: T,
pub l: T,
pub a: T,
}
Expand description
HSLA color. Convert into/from Rgba via the From and Into traits.
Fields§
§h: T
Hue
s: T
Saturation
l: T
Lightness
a: T
Alpha (opacity)
Implementations§
§impl<T> Hsla<T>where
T: ColorComponent,
impl<T> Hsla<T>where
T: ColorComponent,
pub fn map<F, U>(self, f: F) -> Hsla<U>where
F: Fn(T) -> U,
U: ColorComponent,
pub fn map<F, U>(self, f: F) -> Hsla<U>where
F: Fn(T) -> U,
U: ColorComponent,
Map all component values using same function
pub fn convert<U>(self) -> Hsla<U>where
U: ColorComponent,
pub fn convert<U>(self) -> Hsla<U>where
U: ColorComponent,
Convert color component type
Trait Implementations§
§impl<T> Approx for Hsla<T>where
T: ColorComponent + Approx,
impl<T> Approx for Hsla<T>where
T: ColorComponent + Approx,
§fn approx_distance_to(&self, other: &Hsla<T>) -> f32
fn approx_distance_to(&self, other: &Hsla<T>) -> f32
Get an approximated distance between two values
§fn approx_eq(&self, other: &Self) -> bool
fn approx_eq(&self, other: &Self) -> bool
Check if values are approximately equal using DEFAULT_EPS
§fn approx_eq_eps(&self, other: &Self, eps: f32) -> bool
fn approx_eq_eps(&self, other: &Self, eps: f32) -> bool
Check if values are approximately equal using supplied eps value
§impl<T> Clone for Hsla<T>where
T: Clone + ColorComponent,
impl<T> Clone for Hsla<T>where
T: Clone + ColorComponent,
§impl<T> Debug for Hsla<T>where
T: Debug + ColorComponent,
impl<T> Debug for Hsla<T>where
T: Debug + ColorComponent,
§impl<C1, C2> From<Hsla<C1>> for Rgba<C2>where
C1: ColorComponent,
C2: ColorComponent,
impl<C1, C2> From<Hsla<C1>> for Rgba<C2>where
C1: ColorComponent,
C2: ColorComponent,
§impl<C1, C2> From<Rgba<C1>> for Hsla<C2>where
C1: ColorComponent,
C2: ColorComponent,
impl<C1, C2> From<Rgba<C1>> for Hsla<C2>where
C1: ColorComponent,
C2: ColorComponent,
§impl<T> PartialEq for Hsla<T>where
T: PartialEq + ColorComponent,
impl<T> PartialEq for Hsla<T>where
T: PartialEq + ColorComponent,
impl<T> Copy for Hsla<T>where
T: Copy + ColorComponent,
impl<T> Eq for Hsla<T>where
T: Eq + ColorComponent,
impl<T> StructuralEq for Hsla<T>where
T: ColorComponent,
impl<T> StructuralPartialEq for Hsla<T>where
T: ColorComponent,
Auto Trait Implementations§
impl<T> RefUnwindSafe for Hsla<T>where
T: RefUnwindSafe,
impl<T> Send for Hsla<T>where
T: Send,
impl<T> Sync for Hsla<T>where
T: Sync,
impl<T> Unpin for Hsla<T>where
T: Unpin,
impl<T> UnwindSafe for Hsla<T>where
T: UnwindSafe,
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.