Trait palette::convert::FromColorUnclamped
source · [−]pub trait FromColorUnclamped<T>: Sized {
fn from_color_unclamped(val: T) -> Self;
}
Expand description
A trait for unchecked conversion of one color from another.
See FromColor
for a lossy version of this trait.
See TryFromColor
for a trait that gives an error when the result
is out of bounds.
See the convert
module for how to implement FromColorUnclamped
for
custom colors.
Required Methods
fn from_color_unclamped(val: T) -> Self
fn from_color_unclamped(val: T) -> Self
Convert from T. The resulting color might be invalid in its color space.
use palette::convert::FromColorUnclamped;
use palette::{Clamp, Lch, Srgb};
let rgb = Srgb::from_color_unclamped(Lch::new(50.0, 100.0, -175.0));
assert!(!rgb.is_within_bounds());