[][src]Trait prisma::encoding::TranscodableColor

pub trait TranscodableColor: Color + EncodableColor {
    type IntermediateColor;
    fn encode_color<Encoder>(self, enc: &Encoder) -> Self
    where
        Encoder: ChannelEncoder
;
fn decode_color<Decoder>(self, dec: &Decoder) -> Self
    where
        Decoder: ChannelDecoder
; }

A color that can have its encoding changed

Because of the non-linear nature of encodings, only Rgb can have its encoding changed. The other device-dependent colors can come from an encoding, and may be stored in EncodedColor, but they must go through Rgb for that encoding to change.

Associated Types

type IntermediateColor

The color type used internally to do conversions. This will always have floating-point channels

Loading content...

Required methods

fn encode_color<Encoder>(self, enc: &Encoder) -> Self where
    Encoder: ChannelEncoder

Encode self using the encoder enc

fn decode_color<Decoder>(self, dec: &Decoder) -> Self where
    Decoder: ChannelDecoder

Decode self using the decoder dec

Loading content...

Implementors

impl<T> TranscodableColor for Rgb<T> where
    T: PosNormalChannelScalar + ChannelFormatCast<f64>,
    f64: ChannelFormatCast<T>, 
[src]

type IntermediateColor = Rgb<f64>

impl<T> TranscodableColor for Rgba<T> where
    T: PosNormalChannelScalar + ChannelFormatCast<f64>,
    f64: ChannelFormatCast<T>, 
[src]

type IntermediateColor = Rgba<f64>

Loading content...