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§
Required Methods§
sourcefn shift_hue_assign(&mut self, amount: Self::Scalar)
fn shift_hue_assign(&mut self, amount: Self::Scalar)
Shifts the hue by amount
.