pub struct HSLColor {
pub alpha: f64,
pub hue: f64,
pub saturation: f64,
pub lightness: f64,
}Expand description
A color represented using alpha, hue, saturation, and lightness.
Fields§
§alpha: f64Alpha, from 0.0 to 1.0.
hue: f64Hue, from 0.0 to 360.0.
saturation: f64Saturation, from 0.0 to 1.0.
lightness: f64Lightness, from 0.0 to 1.0.
Implementations§
Source§impl HSLColor
impl HSLColor
Sourcepub fn from_ahsl(
alpha: f64,
hue: f64,
saturation: f64,
lightness: f64,
) -> HSLColor
pub fn from_ahsl( alpha: f64, hue: f64, saturation: f64, lightness: f64, ) -> HSLColor
Creates a color. All arguments must be in their respective ranges.
Sourcepub fn with_alpha(self, alpha: f64) -> HSLColor
pub fn with_alpha(self, alpha: f64) -> HSLColor
Returns a copy of this color with the alpha parameter replaced.
Sourcepub fn with_hue(self, hue: f64) -> HSLColor
pub fn with_hue(self, hue: f64) -> HSLColor
Returns a copy of this color with the hue parameter replaced.
Sourcepub fn with_saturation(self, saturation: f64) -> HSLColor
pub fn with_saturation(self, saturation: f64) -> HSLColor
Returns a copy of this color with the saturation parameter replaced.
Sourcepub fn with_lightness(self, lightness: f64) -> HSLColor
pub fn with_lightness(self, lightness: f64) -> HSLColor
Returns a copy of this color with the lightness parameter replaced.
Trait Implementations§
impl Copy for HSLColor
impl StructuralPartialEq for HSLColor
Auto Trait Implementations§
impl Forget for HSLColor
impl Freeze for HSLColor
impl Move for HSLColor
impl RefUnwindSafe for HSLColor
impl Send for HSLColor
impl Sync for HSLColor
impl Unpin for HSLColor
impl UnsafeUnpin for HSLColor
impl UnwindSafe for HSLColor
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.