Trait palette::Component [−][src]
pub trait Component: Copy + Zero + PartialOrd + NumCast { const LIMITED: bool; fn max_intensity() -> Self; fn convert<T: Component>(&self) -> T; }
Common trait for color components.
Associated Constants
const LIMITED: bool
True if the max intensity is also the highest possible value of the type. Conversion to limited types requires clamping.
Required Methods
fn max_intensity() -> Self
The highest displayable value this component type can reach. Higher values are allowed, but they may be lowered to this before converting to another format.
fn convert<T: Component>(&self) -> T
Convert into another color component type, including scaling.
Implementations on Foreign Types
impl Component for f32
[src]
impl Component for f32
impl Component for f64
[src]
impl Component for f64
impl Component for u8
[src]
impl Component for u8
impl Component for u16
[src]
impl Component for u16
impl Component for u32
[src]
impl Component for u32
impl Component for u64
[src]
impl Component for u64