cosmic::cosmic_theme::palette::convert

Trait IntoColorUnclamped

Source
pub trait IntoColorUnclamped<T>: Sized {
    // Required method
    fn into_color_unclamped(self) -> T;
}
Expand description

A trait for unchecked conversion of a color into another.

U: IntoColorUnclamped<T> is implemented for every type T: FromColorUnclamped<U>.

See FromColorUnclamped for more details.

Required Methods§

Source

fn into_color_unclamped(self) -> T

Convert into T. The resulting color might be invalid in its color space

use palette::convert::IntoColorUnclamped;
use palette::{IsWithinBounds, Lch, Srgb};

let rgb: Srgb = Lch::new(50.0, 100.0, -175.0).into_color_unclamped();
assert!(!rgb.is_within_bounds());

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<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,