Trait cosmic::cosmic_theme::palette::WithHue

source ·
pub trait WithHue<H> {
    // Required method
    fn with_hue(self, hue: H) -> Self;
}
Expand description

Change the hue of a color to a specific value.

See also SetHue, GetHue, ShiftHue and ShiftHueAssign.

use palette::{Hsl, WithHue};

let green = Hsl::new_srgb(120.0, 1.0, 0.5);
let blue = green.with_hue(240.0);
assert_eq!(blue, Hsl::new_srgb(240.0, 1.0, 0.5));

Required Methods§

source

fn with_hue(self, hue: H) -> Self

Return a copy of self with a specific hue.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<C, T, H> WithHue<H> for Alpha<C, T>
where C: WithHue<H>,

source§

impl<S, T, H> WithHue<H> for Hsl<S, T>
where H: Into<RgbHue<T>>,

source§

impl<S, T, H> WithHue<H> for Hsv<S, T>
where H: Into<RgbHue<T>>,

source§

impl<S, T, H> WithHue<H> for Hwb<S, T>
where H: Into<RgbHue<T>>,

source§

impl<T, H> WithHue<H> for Cam16Jch<T>
where H: Into<Cam16Hue<T>>,

source§

impl<T, H> WithHue<H> for Cam16Jmh<T>
where H: Into<Cam16Hue<T>>,

source§

impl<T, H> WithHue<H> for Cam16Jsh<T>
where H: Into<Cam16Hue<T>>,

source§

impl<T, H> WithHue<H> for Cam16Qch<T>
where H: Into<Cam16Hue<T>>,

source§

impl<T, H> WithHue<H> for Cam16Qmh<T>
where H: Into<Cam16Hue<T>>,

source§

impl<T, H> WithHue<H> for Cam16Qsh<T>
where H: Into<Cam16Hue<T>>,

source§

impl<T, H> WithHue<H> for Cam16UcsJmh<T>
where H: Into<Cam16Hue<T>>,

source§

impl<T, H> WithHue<H> for Okhsl<T>
where H: Into<OklabHue<T>>,

source§

impl<T, H> WithHue<H> for Okhsv<T>
where H: Into<OklabHue<T>>,

source§

impl<T, H> WithHue<H> for Okhwb<T>
where H: Into<OklabHue<T>>,

source§

impl<T, H> WithHue<H> for Oklch<T>
where H: Into<OklabHue<T>>,

source§

impl<Wp, T, H> WithHue<H> for Hsluv<Wp, T>
where H: Into<LuvHue<T>>,

source§

impl<Wp, T, H> WithHue<H> for Lch<Wp, T>
where H: Into<LabHue<T>>,

source§

impl<Wp, T, H> WithHue<H> for Lchuv<Wp, T>
where H: Into<LuvHue<T>>,