Class TBGRAColorList

Unit

Declaration

type TBGRAColorList = class(TObject)

Description

Contains a fixed list of colors

Hierarchy

Overview

Fields

Protected FColors: array of TBGRAColorDefinition;
Protected FFinished: boolean;
Protected FNbColors: integer;

Methods

Public constructor Create;
Public function IndexOf(Name: string): integer;
Public function IndexOfColor(const AColor: TBGRAPixel; AMaxDiff: Word = 0): integer;
Protected function GetByIndex(Index: integer): TBGRAPixel;
Protected function GetByName(Name: string): TBGRAPixel;
Protected function GetName(Index: integer): string;
Public procedure Add(Name: string; const Color: TBGRAPixel); overload;
Public procedure Finished;
Protected procedure Add(Name: string; out Color: TBGRAPixel; red,green,blue: byte); overload;

Properties

Public property ByIndex[Index: integer]: TBGRAPixel read GetByIndex;
Public property ByName[Name: string]: TBGRAPixel read GetByName;
Public property Count: integer read FNbColors;
Public property Name[Index: integer]: string read GetName;

Description

Fields

Protected FColors: array of TBGRAColorDefinition;

This item has no description.

Protected FFinished: boolean;

This item has no description.

Protected FNbColors: integer;

This item has no description.

Methods

Public constructor Create;

Creates an empty color list

Public function IndexOf(Name: string): integer;

Returns the index of a color with a given name

Public function IndexOfColor(const AColor: TBGRAPixel; AMaxDiff: Word = 0): integer;

Returns the index of a color. Colors are considered to match if the difference is less than or equal to AMaxDiff

Protected function GetByIndex(Index: integer): TBGRAPixel;

This item has no description.

Protected function GetByName(Name: string): TBGRAPixel;

This item has no description.

Protected function GetName(Index: integer): string;

This item has no description.

Public procedure Add(Name: string; const Color: TBGRAPixel); overload;

Add a color to the list

Public procedure Finished;

Ends the color list and prevents further modifications

Protected procedure Add(Name: string; out Color: TBGRAPixel; red,green,blue: byte); overload;

This item has no description.

Properties

Public property ByIndex[Index: integer]: TBGRAPixel read GetByIndex;

Gets the color at the specified index

Public property ByName[Name: string]: TBGRAPixel read GetByName;

Gets the color associated with a color name

Public property Count: integer read FNbColors;

Gets the number of colors

Public property Name[Index: integer]: string read GetName;

Gets the name of the color at the specified index