Skip to main content

ToColor

Trait ToColor 

Source
pub trait ToColor<P>: Sized
where P: Primitive,
{ type ToRgba<R: Primitive>: ToColor<R>; type ToHsla<R: Float>: ToColor<R>;
Show 16 methods // Required methods fn to_rgba_of<R>(self) -> Self::ToRgba<R> where R: Primitive + CastRangeFrom<P>; fn to_hsla_of<R>(self) -> Self::ToHsla<R> where R: Float + CastRangeFrom<P>; // Provided methods fn to_hsla(self) -> Self::ToHsla<f32> where f32: CastRangeFrom<P> { ... } fn to_hsla_f32(self) -> Self::ToHsla<f32> where f32: CastRangeFrom<P> { ... } fn to_hsla_f64(self) -> Self::ToHsla<f64> where f64: CastRangeFrom<P> { ... } fn to_rgba(self) -> Self::ToRgba<f32> where f32: CastRangeFrom<P> { ... } fn to_rgba_f32(self) -> Self::ToRgba<f32> where f32: CastRangeFrom<P> { ... } fn to_rgba_f64(self) -> Self::ToRgba<f64> where f64: CastRangeFrom<P> { ... } fn to_rgba_u8(self) -> Self::ToRgba<u8> where u8: CastRangeFrom<P> { ... } fn to_rgba_u16(self) -> Self::ToRgba<u16> where u16: CastRangeFrom<P> { ... } fn to_color(self) -> Self::ToRgba<f32> where f32: CastRangeFrom<P> { ... } fn to_color_float(self) -> Self::ToRgba<f32> where f32: CastRangeFrom<P> { ... } fn to_color_f32(self) -> Self::ToRgba<f32> where f32: CastRangeFrom<P> { ... } fn to_color_f64(self) -> Self::ToRgba<f64> where f64: CastRangeFrom<P> { ... } fn to_color_u8(self) -> Self::ToRgba<u8> where u8: CastRangeFrom<P> { ... } fn to_color_u16(self) -> Self::ToRgba<u16> where u16: CastRangeFrom<P> { ... }
}

Required Associated Types§

Required Methods§

Source

fn to_rgba_of<R>(self) -> Self::ToRgba<R>
where R: Primitive + CastRangeFrom<P>,

Source

fn to_hsla_of<R>(self) -> Self::ToHsla<R>
where R: Float + CastRangeFrom<P>,

Provided Methods§

Source

fn to_hsla(self) -> Self::ToHsla<f32>
where f32: CastRangeFrom<P>,

Source

fn to_hsla_f32(self) -> Self::ToHsla<f32>
where f32: CastRangeFrom<P>,

Source

fn to_hsla_f64(self) -> Self::ToHsla<f64>
where f64: CastRangeFrom<P>,

Source

fn to_rgba(self) -> Self::ToRgba<f32>
where f32: CastRangeFrom<P>,

Source

fn to_rgba_f32(self) -> Self::ToRgba<f32>
where f32: CastRangeFrom<P>,

Source

fn to_rgba_f64(self) -> Self::ToRgba<f64>
where f64: CastRangeFrom<P>,

Source

fn to_rgba_u8(self) -> Self::ToRgba<u8>
where u8: CastRangeFrom<P>,

Source

fn to_rgba_u16(self) -> Self::ToRgba<u16>
where u16: CastRangeFrom<P>,

Source

fn to_color(self) -> Self::ToRgba<f32>
where f32: CastRangeFrom<P>,

Source

fn to_color_float(self) -> Self::ToRgba<f32>
where f32: CastRangeFrom<P>,

Source

fn to_color_f32(self) -> Self::ToRgba<f32>
where f32: CastRangeFrom<P>,

Source

fn to_color_f64(self) -> Self::ToRgba<f64>
where f64: CastRangeFrom<P>,

Source

fn to_color_u8(self) -> Self::ToRgba<u8>
where u8: CastRangeFrom<P>,

Source

fn to_color_u16(self) -> Self::ToRgba<u16>
where u16: CastRangeFrom<P>,

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.

Implementations on Foreign Types§

Source§

impl<T, P> ToColor<P> for Vec<T>
where P: Primitive, T: ToColor<P>,

Source§

type ToRgba<R: Primitive> = Vec<<T as ToColor<P>>::ToRgba<R>>

Source§

type ToHsla<R: Float> = Vec<<T as ToColor<P>>::ToHsla<R>>

Source§

fn to_rgba_of<R>(self) -> <Vec<T> as ToColor<P>>::ToRgba<R>
where R: Primitive + CastRangeFrom<P>,

Source§

fn to_hsla_of<R>(self) -> <Vec<T> as ToColor<P>>::ToHsla<R>
where R: Float + CastRangeFrom<P>,

Source§

impl<T, const N: usize, P> ToColor<P> for [T; N]
where P: Primitive, T: ToColor<P>,

Source§

type ToRgba<R: Primitive> = [<T as ToColor<P>>::ToRgba<R>; N]

Source§

type ToHsla<R: Float> = [<T as ToColor<P>>::ToHsla<R>; N]

Source§

fn to_rgba_of<R>(self) -> <[T; N] as ToColor<P>>::ToRgba<R>
where R: Primitive + CastRangeFrom<P>,

Source§

fn to_hsla_of<R>(self) -> <[T; N] as ToColor<P>>::ToHsla<R>
where R: Float + CastRangeFrom<P>,

Implementors§

Source§

impl<'a, P, T, Idx, const N: usize> ToColor<P> for GridView<'a, GridOf<T, Idx, N>, T, Idx, N>
where Idx: Integer, T: ToColor<P> + Copy, P: Primitive,

Source§

type ToRgba<R: Primitive> = GridOf<<T as ToColor<P>>::ToRgba<R>, Idx, N>

Source§

type ToHsla<R: Float> = GridOf<<T as ToColor<P>>::ToHsla<R>, Idx, N>

Source§

impl<'a, P, T, Idx, const N: usize> ToColor<P> for GridViewMut<'a, GridOf<T, Idx, N>, T, Idx, N>
where Idx: Integer, T: ToColor<P> + Copy, P: Primitive,

Source§

type ToRgba<R: Primitive> = GridOf<<T as ToColor<P>>::ToRgba<R>, Idx, N>

Source§

type ToHsla<R: Float> = GridOf<<T as ToColor<P>>::ToHsla<R>, Idx, N>

Source§

impl<P> ToColor<P> for RgbaOf<P>
where P: Primitive,

Source§

impl<P, T, Idx, const N: usize> ToColor<P> for GridOf<T, Idx, N>
where Idx: Integer, T: ToColor<P>, P: Primitive,

Source§

type ToRgba<R: Primitive> = GridOf<<T as ToColor<P>>::ToRgba<R>, Idx, N>

Source§

type ToHsla<R: Float> = GridOf<<T as ToColor<P>>::ToHsla<R>, Idx, N>

Source§

impl<T> ToColor<T> for HslaOf<T>
where T: Float,

Source§

impl<T, C, Idx> ToColor<T> for ImageBaseOf<C, Idx>
where Idx: Integer, C: ToColor<T>, T: Primitive,

Source§

type ToRgba<R: Primitive> = ImageBaseOf<<C as ToColor<T>>::ToRgba<R>, Idx>

Source§

type ToHsla<R: Float> = ImageBaseOf<<C as ToColor<T>>::ToHsla<R>, Idx>