cosmic::cosmic_theme::palette

Trait ShiftHue

Source
pub trait ShiftHue {
    type Scalar;

    // Required method
    fn shift_hue(self, amount: Self::Scalar) -> Self;
}
Expand description

Operator for increasing or decreasing the hue by an amount.

See also ShiftHueAssign, WithHue, SetHue and GetHue.

use palette::{Hsl, ShiftHue};

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

Required Associated Types§

Source

type Scalar

The type of the hue modifier.

Required Methods§

Source

fn shift_hue(self, amount: Self::Scalar) -> Self

Return a copy of self with the hue shifted by amount.

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> ShiftHue for Alpha<C, T>
where C: ShiftHue,

Source§

impl<S, T> ShiftHue for Hsl<S, T>
where T: Add<Output = T>,

Source§

impl<S, T> ShiftHue for Hsv<S, T>
where T: Add<Output = T>,

Source§

impl<S, T> ShiftHue for Hwb<S, T>
where T: Add<Output = T>,

Source§

impl<T> ShiftHue for Cam16Jch<T>
where T: Add<Output = T>,

Source§

impl<T> ShiftHue for Cam16Jmh<T>
where T: Add<Output = T>,

Source§

impl<T> ShiftHue for Cam16Jsh<T>
where T: Add<Output = T>,

Source§

impl<T> ShiftHue for Cam16Qch<T>
where T: Add<Output = T>,

Source§

impl<T> ShiftHue for Cam16Qmh<T>
where T: Add<Output = T>,

Source§

impl<T> ShiftHue for Cam16Qsh<T>
where T: Add<Output = T>,

Source§

impl<T> ShiftHue for Cam16UcsJmh<T>
where T: Add<Output = T>,

Source§

impl<T> ShiftHue for Okhsl<T>
where T: Add<Output = T>,

Source§

impl<T> ShiftHue for Okhsv<T>
where T: Add<Output = T>,

Source§

impl<T> ShiftHue for Okhwb<T>
where T: Add<Output = T>,

Source§

impl<T> ShiftHue for Oklch<T>
where T: Add<Output = T>,

Source§

impl<Wp, T> ShiftHue for Hsluv<Wp, T>
where T: Add<Output = T>,

Source§

impl<Wp, T> ShiftHue for Lch<Wp, T>
where T: Add<Output = T>,

Source§

impl<Wp, T> ShiftHue for Lchuv<Wp, T>
where T: Add<Output = T>,