Method XbpPresSpace():maxColorIndex() Foundation
Returns the number of colors that can be simultaneously defined in the color palette.
:maxColorIndex( [<lCompatible>] ) --> nMaxColors
This method returns a numeric value indicating the maximum number of colors that can be simultaneously defined in a presentation space's color palette. This value depends on the device context linked to the presentation space (it is device dependent).
When the device context supports a 16-bit or higher color depth and .F. (false) is passed for <lCompatible>, the return value is 0. If .T. (true) is passed, a numeric value greater than zero is returned regardless of the color depth.
The :maxColorIndex() method is used to determine the maximum value that can be specified for the method :setColorIndex(). This value depends on the hardware (graphics card or printer) and is 255 when the device context supports 8-bit colors. This means that a maximum of 256 colors can be defined and used at the same time (values for :maxColorIndex() begin with 0).
Today's graphics cards generally support 24-bit colors, or true colors, which means that colors can be defined without a color palette. In this case, colors are defined using RGB-values (see GraMakeRGBColor() ). To test whether or not colors can be defined as RGB values, the method is used as follows:
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.