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§
Object Safety§
This trait is not object safe.