Method XbpBitmap():getColorTable() Foundation

Retrieves the color table of a bitmap.

:getColorTable( [<nNumColors>] ) --> aRGBColors|NIL
The optional parameter <nNumColors> specifies the number of colors the returned color table should consist of.

The method returns a two dimensional array with three columns. Each element contains an array {nRed, nGreen, nBlue} representing the color intensities for a RGB color.

True color bitmaps do not have a color table. Therefore, the parameter <nNumColors> must be specified for the method to return an array. If no parameter is passed with a true color bitmap, the return value is NIL.


The :getColorTable() method retrieves the color table of a bitmap. The returned array can be passed to the :setColorIndex() method of a presentation space. If <nNumColors> is not specified, the method returns a color table only for bitmaps with a color depth of 8 bit or less. Bitmaps having a greater color depths do not have a color table and the return value is NIL in this case.

If <nNumColors> is given, a color table is synthesized with the number of colors requested. This can be used for color reduction, for example, i.e. to display a true-color bitmap on a system running a lower color resolution.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.