# Palette class

Namespace: [Eto.Drawing](https://eto.picoe.ca/api/namespace/eto.drawing.md) · Assembly: [Eto](https://eto.picoe.ca/api/assembly/eto.md)

```cs
public class Palette : ObservableCollection<Color>, ICloneable
```

Represents a collection of [Color](https://eto.picoe.ca/api/type/eto.drawing.color.md) objects

**Remarks:** Typically used for [IndexedBitmap](https://eto.picoe.ca/api/type/eto.drawing.indexedbitmap.md) or other purposes where a collection of colors is needed. This class keeps a cache of 32-bit ARGB values for each element in the collection for faster retrieval. These values are generated using [Color.ToArgb()](https://eto.picoe.ca/api/type/eto.drawing.color/toargb.md).

## Constructors

- [Palette](https://eto.picoe.ca/api/type/eto.drawing.palette/ctor.md): (2 overloads) Initializes a new instance of the Pallette class

## Properties

- [EGAColors](https://eto.picoe.ca/api/type/eto.drawing.palette/egacolors.md): (static) Gets the index of standard EGA colors from a 64-color palette

## Methods

- [AddRange](https://eto.picoe.ca/api/type/eto.drawing.palette/addrange.md): Adds the specified `colors` to this palette collection
- [ClearItems](https://eto.picoe.ca/api/type/eto.drawing.palette/clearitems.md): Called when clearing the items, to clear the cached argb values
- [Clone](https://eto.picoe.ca/api/type/eto.drawing.palette/clone.md): Creates a clone of this palette
- [Equals](https://eto.picoe.ca/api/type/eto.drawing.palette/equals.md): Gets a value indicating that this object is equal to the specified `obj`
- [FindAddColour](https://eto.picoe.ca/api/type/eto.drawing.palette/findaddcolour.md): Finds the index of the specified color, or adds it if it does not exist
- [FindClosest](https://eto.picoe.ca/api/type/eto.drawing.palette/findclosest.md): Finds the closest color in this palette to the specified `color`
- [FromEGA](https://eto.picoe.ca/api/type/eto.drawing.palette/fromega.md): (static) Gets the standard 16 colors of the specified EGA palette, at the indexes specified with [Palette.EGAColors](https://eto.picoe.ca/api/type/eto.drawing.palette/egacolors.md)
- [GetDosPalette](https://eto.picoe.ca/api/type/eto.drawing.palette/getdospalette.md): (static) Gets the standard 16-color palette used in DOS
- [GetEgaPalette](https://eto.picoe.ca/api/type/eto.drawing.palette/getegapalette.md): (static) Gets the standard 64-color EGA palette
- [GetHashCode](https://eto.picoe.ca/api/type/eto.drawing.palette/gethashcode.md): Gets the hash code for this palette
- [GetRGBColor](https://eto.picoe.ca/api/type/eto.drawing.palette/getrgbcolor.md): Gets the cached ARGB value of the color at the specified `index`
- [InsertItem](https://eto.picoe.ca/api/type/eto.drawing.palette/insertitem.md): Called when inserting a color, to insert the cached argb value of the color
- [Load](https://eto.picoe.ca/api/type/eto.drawing.palette/load.md): Loads the palette from the specified binary reader in (A)RGB components
- [RemoveItem](https://eto.picoe.ca/api/type/eto.drawing.palette/removeitem.md): Called when removing an item, to remove the cached argb value of the color
- [Save](https://eto.picoe.ca/api/type/eto.drawing.palette/save.md): Saves this palette to the specified binary writer in (A)RGB components
- [SetItem](https://eto.picoe.ca/api/type/eto.drawing.palette/setitem.md): Called when setting a color in the palette, to set the cached argb value of the color
- [ICloneable.Clone](https://eto.picoe.ca/api/type/eto.drawing.palette/system-icloneable-clone.md): Creates a clone of this palette
