Skip to content

TSdlPalette

A set of indexed colors representing a palette.

Definition

Unit: Neslib.Sdl3.Video

type TSdlPalette = record ... end;

Properties

Name Description
Colors Pointer to an array of colors, NumColors long.
NumColors Number of elements in Colors.

Constructors

Name Description
Create Create a palette with the specified number of color entries.

Operators

Name Description
Equal(TSdlPalette, TSdlPalette) Used to compare against another TSdlPalette.
Equal(TSdlPalette, Pointer) Used to compare against nil.
Implicit Used to set the value to nil.
NotEqual(TSdlPalette, TSdlPalette) Used to compare against another TSdlPalette.
NotEqual(TSdlPalette, Pointer) Used to compare against nil.

Methods

Name Description
Free Free the palette.
SetColors(TSdlColor[], Integer, Integer) Set a range of colors in a palette.
SetColors(TArray<TSdlColor>, Integer, Integer) Set a range of colors in a palette.

Property Descriptions

Colors

Pointer to an array of colors, NumColors long.

property Colors: PSdlColor read GetColors

Type: PSdlColor


NumColors

Number of elements in Colors.

property NumColors: Integer read GetNumColors

Type: Integer


Constructor Descriptions

Create

Create a palette with the specified number of color entries.

The palette entries are initialized to white.

constructor Create(const ANumColors: Integer)

Parameters

ANumColors: Integer : The number of color entries in the color palette.

Exceptions

ESdlError: Raised on failure.

See Also

Remarks

It is safe to call this constructor from any thread.


Operator Descriptions

Equal(TSdlPalette, TSdlPalette)

Used to compare against another TSdlPalette.

class operator Equal(const ALeft, ARight: TSdlPalette): Boolean; inline; static

Parameters

ALeft: TSdlPalette

ARight: TSdlPalette

Returns

Boolean


Equal(TSdlPalette, Pointer)

Used to compare against nil.

class operator Equal(const ALeft: TSdlPalette; const ARight: Pointer): Boolean; inline; static

Parameters

ALeft: TSdlPalette

ARight: Pointer

Returns

Boolean


Implicit(Pointer)

Used to set the value to nil.

class operator Implicit(const AValue: Pointer): TSdlPalette; inline; static

Parameters

AValue: Pointer

Returns

TSdlPalette


NotEqual(TSdlPalette, TSdlPalette)

Used to compare against another TSdlPalette.

class operator NotEqual(const ALeft, ARight: TSdlPalette): Boolean; inline; static

Parameters

ALeft: TSdlPalette

ARight: TSdlPalette

Returns

Boolean


NotEqual(TSdlPalette, Pointer)

Used to compare against nil.

class operator NotEqual(const ALeft: TSdlPalette; const ARight: Pointer): Boolean; inline; static

Parameters

ALeft: TSdlPalette

ARight: Pointer

Returns

Boolean


Method Descriptions

Free

Free the palette.

procedure Free; inline

Remarks

It is safe to call this method from any thread, as long as the palette is not modified or destroyed in another thread.


SetColors(TSdlColor[], Integer, Integer)

Set a range of colors in a palette.

procedure SetColors(const AColors: array of TSdlColor; const AFirstColor: Integer = 0; const ANumColors: Integer = 0); overload

Exceptions

ESdlError: Raised on failure.

Parameters

AColors: array of TSdlColor : A array of TSdlColor record to copy into the palette.

AFirstColor: Integer = 0 : (Optional) index of the first palette entry to modify.

ANumColors: Integer = 0 : (Optional) number of entries to modify. Use 0 (default) to se the length of AColors.

Remarks

It is safe to call this method from any thread, as long as the palette is not modified or destroyed in another thread.


SetColors(TArray<TSdlColor>, Integer, Integer)

Set a range of colors in a palette.

procedure SetColors(const AColors: TArray<TSdlColor>; const AFirstColor: Integer = 0; const ANumColors: Integer = 0); overload; inline

Exceptions

ESdlError: Raised on failure.

Parameters

AColors: TArray<TSdlColor> : A array of TSdlColor record to copy into the palette.

AFirstColor: Integer = 0 : (Optional) index of the first palette entry to modify.

ANumColors: Integer = 0 : (Optional) number of entries to modify. Use 0 (default) to se the length of AColors.

Remarks

It is safe to call this method from any thread, as long as the palette is not modified or destroyed in another thread.