cosmic::cosmic_theme::palette

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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>>,