Click or drag to resize

Palette Class

Represents a collection of Color objects
Inheritance Hierarchy
SystemObject
  System.Collections.ObjectModelCollectionColor
    System.Collections.ObjectModelObservableCollectionColor
      Eto.DrawingPalette

Namespace:  Eto.Drawing
Assembly:  Eto (in Eto.dll) Version: 2.4.0
Syntax
public class Palette : ObservableCollection<Color>

The Palette type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyStatic memberEGAColors
Gets the index of standard EGA colors from a 64-color palette
Top
Methods
  NameDescription
Public methodAddRange
Adds the specified colors to this palette collection
Protected methodClearItems
Called when clearing the items, to clear the cached argb values
(Overrides ObservableCollectionTClearItems.)
Public methodClone
Creates a clone of this palette
Public methodEquals
Gets a value indicating that this object is equal to the specified obj
(Overrides ObjectEquals(Object).)
Public methodFindAddColour
Finds the index of the specified color, or adds it if it does not exist
Public methodFindClosest
Finds the closest color in this palette to the specified color
Public methodStatic memberFromEGA
Gets the standard 16 colors of the specified EGA palette, at the indexes specified with EGAColors
Public methodStatic memberGetDosPalette
Gets the standard 16-color palette used in DOS
Public methodStatic memberGetEgaPalette
Gets the standard 64-color EGA palette
Public methodGetHashCode
Gets the hash code for this palette
(Overrides ObjectGetHashCode.)
Public methodGetRGBColor
Gets the cached ARGB value of the color at the specified index
Protected methodInsertItem
Called when inserting a color, to insert the cached argb value of the color
(Overrides ObservableCollectionTInsertItem(Int32, T).)
Public methodLoad
Loads the palette from the specified binary reader in (A)RGB components
Protected methodRemoveItem
Called when removing an item, to remove the cached argb value of the color
(Overrides ObservableCollectionTRemoveItem(Int32).)
Public methodSave
Saves this palette to the specified binary writer in (A)RGB components
Protected methodSetItem
Called when setting a color in the palette, to set the cached argb value of the color
(Overrides ObservableCollectionTSetItem(Int32, T).)
Top
Remarks
Typically used for IndexedBitmap 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 ToArgb.
See Also