pub trait ComponentWise {
    type Scalar;

    // Required methods
    fn component_wise<F>(&self, other: &Self, f: F) -> Self
       where F: FnMut(Self::Scalar, Self::Scalar) -> Self::Scalar;
    fn component_wise_self<F>(&self, f: F) -> Self
       where F: FnMut(Self::Scalar) -> Self::Scalar;
}
Expand description

Perform a unary or binary operation on each component of a color.

Required Associated Types§

source

type Scalar

The scalar type for color components.

Required Methods§

source

fn component_wise<F>(&self, other: &Self, f: F) -> Self
where F: FnMut(Self::Scalar, Self::Scalar) -> Self::Scalar,

Perform a binary operation on this and an other color.

source

fn component_wise_self<F>(&self, f: F) -> Self
where F: FnMut(Self::Scalar) -> Self::Scalar,

Perform a unary operation on this color.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<C, T> ComponentWise for PreAlpha<C, T>
where C: ComponentWise<Scalar = T>, T: Float,

§

type Scalar = T

source§

impl<C, T> ComponentWise for Alpha<C, T>
where C: ComponentWise<Scalar = T>, T: Clone,

§

type Scalar = T

source§

impl<S, T> ComponentWise for Luma<S, T>
where T: Component, S: LumaStandard,

§

type Scalar = T

source§

impl<S, T> ComponentWise for Rgb<S, T>
where S: RgbStandard, T: Component,

§

type Scalar = T

source§

impl<Wp, T> ComponentWise for Lab<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Scalar = T

source§

impl<Wp, T> ComponentWise for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Scalar = T

source§

impl<Wp, T> ComponentWise for Yxy<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Scalar = T