Public Types | |
typedef nearestColour | nearestColor |
Public Member Functions | |
this (PaletteEntry[] entries) | |
Constructs a new palette. | |
this (RGBColour[] entries) | |
Constructs a new palette. | |
this (HPALETTE h, bool autoDelete=false) | |
Constructs a Palette wrapper around a pre-existing API palette object. | |
RGBColour | nearestColour (RGBColour c) |
Finds the nearest colour in this palette to the specified colour. | |
uint | nearestIndex (RGBColour c) |
Finds the index of nearest colour in this palette to the specified colour. | |
Palette | dup () |
Creates an exact copy of the palette. | |
uint | length () |
The number of entries in this palette. | |
HANDLE | clipboardDataHandle (CLIPBOARD_FORMAT format, bool clearAutoDelete=true) |
Data handle to this object for placing on the clipboard. | |
Operators | |
PaletteEntry | opIndex (uint index) |
Gets the entry at the given position in the palette. | |
PaletteEntry | opIndexAssign (PaletteEntry entry, uint index) |
Sets an entry in the palette. | |
PaletteEntry | opIndexAssign (RGBColour entry, uint index) |
Sets an entry in the palette. | |
PaletteEntry[] | opSlice () |
Returns an array of all the entries in the palette. | |
PaletteEntry[] | opSlice (uint begin, uint end) |
Returns a range of entries in the palette. | |
PaletteEntry[] | opSliceAssign (PaletteEntry[] entries) |
Sets all entries in the palette. | |
PaletteEntry[] | opSliceAssign (PaletteEntry[] entries, uint begin, uint end) |
Sets a range of entries in the palette. |
typedef nearestColour smjg.libs.sdwf.gdiobject.Palette.nearestColor |
smjg.libs.sdwf.gdiobject.Palette.this | ( | PaletteEntry[] | entries | ) |
Constructs a new palette.
entries | the entries that make up the palette. |
smjg.libs.sdwf.gdiobject.Palette.this | ( | RGBColour[] | entries | ) |
Constructs a new palette.
entries | the colours that make up the palette. |
smjg.libs.sdwf.gdiobject.Palette.this | ( | HPALETTE | h, | |
bool | autoDelete = false | |||
) |
Constructs a Palette wrapper around a pre-existing API palette object.
h | handle of the palette to wrap. | |
autoDelete | (since 0.5) whether the Windows handle should be automatically deleted when the SDWF object is garbage collected. |
RGBColour smjg.libs.sdwf.gdiobject.Palette.nearestColour | ( | RGBColour | c | ) |
uint smjg.libs.sdwf.gdiobject.Palette.nearestIndex | ( | RGBColour | c | ) |
Palette smjg.libs.sdwf.gdiobject.Palette.dup | ( | ) |
Creates an exact copy of the palette.
uint smjg.libs.sdwf.gdiobject.Palette.length | ( | ) |
The number of entries in this palette.
HANDLE smjg.libs.sdwf.gdiobject.Palette.clipboardDataHandle | ( | CLIPBOARD_FORMAT | format, | |
bool | clearAutoDelete = true | |||
) |
PaletteEntry smjg.libs.sdwf.gdiobject.Palette.opIndex | ( | uint | index | ) |
Gets the entry at the given position in the palette.
(Implementation of this[i]
.)
PaletteEntry smjg.libs.sdwf.gdiobject.Palette.opIndexAssign | ( | PaletteEntry | entry, | |
uint | index | |||
) |
Sets an entry in the palette.
(Implementation of this[i] = entry
.)
entry | entry to place at this position. | |
index | index to set. |
PaletteEntry smjg.libs.sdwf.gdiobject.Palette.opIndexAssign | ( | RGBColour | entry, | |
uint | index | |||
) |
Sets an entry in the palette.
(Implementation of this[i] = entry
.)
This method is syntactic sugar for opIndexAssign(PaletteEntry, uint) to set by an RGBColour.
entry | colour to place at this position. | |
index | index to set. |
PaletteEntry [] smjg.libs.sdwf.gdiobject.Palette.opSlice | ( | ) |
PaletteEntry [] smjg.libs.sdwf.gdiobject.Palette.opSlice | ( | uint | begin, | |
uint | end | |||
) |
Returns a range of entries in the palette.
(Implementation of this[begin..end]
.)
begin | index of first entry to retrieve. | |
end | index one beyond the last entry to retrieve. |
PaletteEntry [] smjg.libs.sdwf.gdiobject.Palette.opSliceAssign | ( | PaletteEntry[] | entries | ) |
Sets all entries in the palette.
(Implementation of this[] = entries
.)
entries | array of entries to place in the palette. |
PaletteEntry [] smjg.libs.sdwf.gdiobject.Palette.opSliceAssign | ( | PaletteEntry[] | entries, | |
uint | begin, | |||
uint | end | |||
) |
Sets a range of entries in the palette.
(Implementation of this[begin..end] = entries
.)
entries | array of entries to place in the palette. | |
begin | index of first entry to set. | |
end | index one beyond the last entry to set. |