palette

Trait ShiftHueAssign

source
pub trait ShiftHueAssign {
    type Scalar;

    // Required method
    fn shift_hue_assign(&mut self, amount: Self::Scalar);
}
Expand description

Assigning operator for increasing or decreasing the hue by an amount.

See also ShiftHue, WithHue, SetHue and GetHue.

use palette::{Hsl, ShiftHueAssign};

let mut color = Hsl::new_srgb(120.0, 1.0, 0.5);
color.shift_hue_assign(120.0);
assert_eq!(color, Hsl::new_srgb(240.0, 1.0, 0.5));

ShiftHueAssign is also implemented for [T]:

use palette::{Hsl, ShiftHueAssign};

let mut my_vec = vec![Hsl::new_srgb(104.0, 0.3, 0.8), Hsl::new_srgb(113.0, 0.5, 0.8)];
let mut my_array = [Hsl::new_srgb(104.0, 0.3, 0.8), Hsl::new_srgb(113.0, 0.5, 0.8)];
let mut my_slice = &mut [Hsl::new_srgb(104.0, 0.3, 0.8), Hsl::new_srgb(112.0, 0.5, 0.8)];

my_vec.shift_hue_assign(120.0);
my_array.shift_hue_assign(120.0);
my_slice.shift_hue_assign(120.0);

Required Associated Types§

source

type Scalar

The type of the hue modifier.

Required Methods§

source

fn shift_hue_assign(&mut self, amount: Self::Scalar)

Shifts the hue by amount.

Implementations on Foreign Types§

source§

impl<T> ShiftHueAssign for [T]
where T: ShiftHueAssign, T::Scalar: Clone,

source§

type Scalar = <T as ShiftHueAssign>::Scalar

source§

fn shift_hue_assign(&mut self, amount: Self::Scalar)

Implementors§

source§

impl<C, T> ShiftHueAssign for Alpha<C, T>
where C: ShiftHueAssign,

source§

impl<S, T> ShiftHueAssign for Hsl<S, T>
where T: AddAssign,

source§

impl<S, T> ShiftHueAssign for Hsv<S, T>
where T: AddAssign,

source§

impl<S, T> ShiftHueAssign for Hwb<S, T>
where T: AddAssign,

source§

impl<T> ShiftHueAssign for Cam16Jch<T>
where T: AddAssign,

source§

impl<T> ShiftHueAssign for Cam16Jmh<T>
where T: AddAssign,

source§

impl<T> ShiftHueAssign for Cam16Jsh<T>
where T: AddAssign,

source§

impl<T> ShiftHueAssign for Cam16Qch<T>
where T: AddAssign,

source§

impl<T> ShiftHueAssign for Cam16Qmh<T>
where T: AddAssign,

source§

impl<T> ShiftHueAssign for Cam16Qsh<T>
where T: AddAssign,

source§

impl<T> ShiftHueAssign for Cam16UcsJmh<T>
where T: AddAssign,

source§

impl<T> ShiftHueAssign for Okhsl<T>
where T: AddAssign,

source§

impl<T> ShiftHueAssign for Okhsv<T>
where T: AddAssign,

source§

impl<T> ShiftHueAssign for Okhwb<T>
where T: AddAssign,

source§

impl<T> ShiftHueAssign for Oklch<T>
where T: AddAssign,

source§

impl<Wp, T> ShiftHueAssign for Hsluv<Wp, T>
where T: AddAssign,

source§

impl<Wp, T> ShiftHueAssign for Lch<Wp, T>
where T: AddAssign,

source§

impl<Wp, T> ShiftHueAssign for Lchuv<Wp, T>
where T: AddAssign,