# [−][src]Trait image::imageops::colorops::ColorMap

    pub trait ColorMap {
        type Color;
        fn index_of(&self, color: &Self::Color) -> usize;
        fn map_color(&self, color: &mut Self::Color);
    }

A color map

## Associated Types

### `type Color`

The color type on which the map operates on

Loading content...

## Required methods

### `fn index_of(&self, color: &Self::Color) -> usize`

Returns the index of the closed match of `color` in the color map.

### `fn map_color(&self, color: &mut Self::Color)`

Maps `color` to the closest color in the color map.

Loading content...

## Implementors

### `impl ColorMap for BiLevel`[src]

#### `type Color = Luma<u8>`

#### `fn index_of(&self, color: &Luma<u8>) -> usize`[src]

#### `fn map_color(&self, color: &mut Luma<u8>)`[src]

### `impl ColorMap for NeuQuant`[src]

#### `type Color = Rgba<u8>`

#### `fn index_of(&self, color: &Rgba<u8>) -> usize`[src]

#### `fn map_color(&self, color: &mut Rgba<u8>)`[src]

Loading content...

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)