pub struct Hct { /* private fields */ }
Implementations§
Source§impl Hct
impl Hct
Sourcepub fn from(hue: f64, chroma: f64, tone: f64) -> Hct
pub fn from(hue: f64, chroma: f64, tone: f64) -> Hct
Create an HCT color from hue, chroma, and tone.
§Arguments
hue
: hue 0 <= hue < 360; invalid values are corrected.chrome
: chroma 0 <= chroma < ?; Informally, colorfulness. The color returned may be lower than the requested chroma. Chroma has a different maximum for any given hue and tone.tone
: tone 0 <= tone <= 100; invalid values are corrected.
returns: HCT representation of a color in default viewing conditions.
Sourcepub fn from_int(argb: [u8; 4]) -> Hct
pub fn from_int(argb: [u8; 4]) -> Hct
Create an HCT color from a color.
§Arguments
argb
: ARGB representation of a color.
returns: HCT representation of a color in default viewing conditions
pub fn hue(&self) -> f64
pub fn chroma(&self) -> f64
pub fn tone(&self) -> f64
pub fn to_int(&self) -> [u8; 4]
Sourcepub fn set_hue(&mut self, hue: f64)
pub fn set_hue(&mut self, hue: f64)
Set the hue of this color. Chroma may decrease because chroma has a different maximum for any given hue and tone.
§Arguments
hue
: 0 <= newHue < 360; invalid values are corrected.
Sourcepub fn set_chroma(&mut self, chroma: f64)
pub fn set_chroma(&mut self, chroma: f64)
Set the chroma of this color. Chroma may decrease because chroma has a different maximum for any given hue and tone.
§Arguments
chroma
: 0 <= newChroma < ?
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hct
impl RefUnwindSafe for Hct
impl Send for Hct
impl Sync for Hct
impl Unpin for Hct
impl UnwindSafe for Hct
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