# ColorType in maplibre::style - Rust
A trait used to simpify the interface of the `Alpha` and `PremultipliedAlpha` types and allow use with `Spaces` enum.

# Trait maplibre::style::ColorType

    pub trait ColorType {
        type ComponentTy: Copy;

        const SPACE: Spaces;
        const NUM_COMPONENTS: usize;
    }

Expand description

A trait used to simpify the interface of the `Alpha` and `PremultipliedAlpha` types and allow use with `Spaces` enum.

## Required Associated Types§

#### type ComponentTy: Copy

## Required Associated Constants§

#### const SPACE: Spaces

#### const NUM_COMPONENTS: usize

## Object Safety§

This trait is not object safe.

## Implementors§

§

### impl<BaseColorTy> ColorType for Alpha<BaseColorTy>
where BaseColorTy: ColorType,

§

#### type ComponentTy = <BaseColorTy as ColorType>::ComponentTy

§

#### const SPACE: Spaces = BaseColorTy::SPACE

§

#### const NUM_COMPONENTS: usize = _

§

### impl<BaseColorTy> ColorType for PremultipliedAlpha<BaseColorTy>
where BaseColorTy: ColorType,

§

#### type ComponentTy = <BaseColorTy as ColorType>::ComponentTy

§

#### const SPACE: Spaces = BaseColorTy::SPACE

§

#### const NUM_COMPONENTS: usize = _

§

### impl<CTy> ColorType for Aces2065<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::Aces2065

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for AcesCc<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::AcesCc

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for AcesCct<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::AcesCct

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for AcesCg<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::AcesCg

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for Bt2020<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::Bt2020

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for Bt2100<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::Bt2100

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for CieLCh<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::CieLCh

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for CieLab<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::CieLab

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for CieXYZ<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::CieXYZ

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for DciP3<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::DciP3

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for DciXYZPrime<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::DciXYZPrime

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for DisplayP3<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::DisplayP3

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for EncodedBt2020<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::EncodedBt2020

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for EncodedBt2100HLG<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::EncodedBt2100HLG

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for EncodedBt2100PQ<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::EncodedBt2100PQ

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for EncodedDisplayP3<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::EncodedDisplayP3

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for EncodedRec709<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::EncodedRec709

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for EncodedSrgb<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::EncodedSrgb

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for GenericColor1<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::GenericColor1

§

#### const NUM_COMPONENTS: usize = 1usize

§

### impl<CTy> ColorType for GenericColor3<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::GenericColor3

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for Hsl<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::Hsl

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for Hsv<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::Hsv

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for ICtCpHLG<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::ICtCpHLG

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for ICtCpPQ<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::ICtCpPQ

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for LinearSrgb<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::LinearSrgb

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for Luma<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::Luma

§

#### const NUM_COMPONENTS: usize = 1usize

§

### impl<CTy> ColorType for Luminance<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::Luminance

§

#### const NUM_COMPONENTS: usize = 1usize

§

### impl<CTy> ColorType for Oklab<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::Oklab

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for Oklch<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::Oklch

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for Rec709<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::Rec709

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for YCbCr<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::YCbCr

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for YCxCz<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::YCxCz

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for YPbPr<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::YPbPr

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for YPrimeCbCr<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::YPrimeCbCr

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for YPrimePbPr<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::YPrimePbPr

§

#### const NUM_COMPONENTS: usize = 3usize

§

### impl<CTy> ColorType for Yuv<CTy>
where CTy: Clone + Copy,

§

#### type ComponentTy = CTy

§

#### const SPACE: Spaces = Spaces::Yuv

§

#### const NUM_COMPONENTS: usize = 3usize