# ColorInterop in maplibre::style - Rust
A trait that should be implemented by provider crates on their local color types so that you can call `color.to_cint()` and `Color::from_cint(cint_color)`.

# Trait maplibre::style::ColorInterop

    pub trait ColorInterop: Into<Self::CintTy> {
        type CintTy: Into<Self>;

        // Provided methods
        fn from_cint(col: Self::CintTy) -> Self { ... }
        fn into_cint(self) -> Self::CintTy { ... }
    }

Expand description

A trait that should be implemented by provider crates on their local color types so that you can call `color.to_cint()` and `Color::from_cint(cint_color)`.

Provider crates should also do relevant `From`/`Into` impls, but `ColorInterop` provides a “canonical” transformation to the closest `cint` color type.

## Required Associated Types§

#### type CintTy: Into<Self>

## Provided Methods§

#### fn from_cint(col: Self::CintTy) -> Self

Convert `self` into its canonical `cint` type.

#### fn into_cint(self) -> Self::CintTy

Create a `Self` from its canonical `cint` type.

## Object Safety§

This trait is not object safe.

## Implementations on Foreign Types§

§

### impl ColorInterop for Color

§

#### type CintTy = Alpha<EncodedSrgb<f64>>

## Implementors§