Vcl.Imaging.GIFImg.TGIFColorMap.AddUnique
Delphi
function AddUnique(Color: TColor): integer;
C++
int __fastcall AddUnique(System::Uitypes::TColor Color);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | Vcl.Imaging.GIFImg.pas Vcl.Imaging.GIFImg.hpp |
Vcl.Imaging.GIFImg | TGIFColorMap |
Description
Adds the given color to the Colors array, making sure it only appears once in the array.
Call AddUnique to add the color specified through Color to the Colors array, priorly making sure that Color is not already an element of the Colors array.
If Color was not found in the array, AddUnique returns the size of the Colors array before adding the Color element.
If Color was found in the array, AddUnique returns the index where it was found and no addition operation takes place.
Because Color is of type TColor, the Color2RGB routine is first used to convert Color to the TGIFColor type, which is the type of the elements in the Colors array.
Note: The addition operation is achieved using the Add method.