Trait palette::ComponentWise
[−]
[src]
pub trait ComponentWise { type Scalar: Float; fn component_wise<F: FnMut(Self::Scalar, Self::Scalar) -> Self::Scalar>(&self, other: &Self, f: F) -> Self; fn component_wise_self<F: FnMut(Self::Scalar) -> Self::Scalar>(&self, f: F) -> Self; }
Perform a unary or binary operation on each component of a color.
Associated Types
type Scalar: Float
The scalar type for color components.
Required Methods
fn component_wise<F: FnMut(Self::Scalar, Self::Scalar) -> Self::Scalar>(&self, other: &Self, f: F) -> Self
Perform a binary operation on this and an other color.
fn component_wise_self<F: FnMut(Self::Scalar) -> Self::Scalar>(&self, f: F) -> Self
Perform a unary operation on this color.
Implementors
impl<C: ComponentWise<Scalar=T>, T: Float> ComponentWise for PreAlpha<C, T>
impl<C: ComponentWise<Scalar=T>, T: Float> ComponentWise for Alpha<C, T>
impl<T: Float> ComponentWise for Rgb<T>
impl<T: Float> ComponentWise for Luma<T>
impl<T: Float> ComponentWise for Yxy<T>
impl<T: Float> ComponentWise for Xyz<T>
impl<T: Float> ComponentWise for Lab<T>