Next: , Previous: %CADBackground, Up: CAD areas and methods

6.3 %CADColors


The plug-in method %CADColors defines a 4D CAD area with a color palette. It can be used in application dialogs. for example to set line colors and fill colors.

To use it, add %CADColors as a variable of type Plug-in Area to a 4D form. The variable must be typed as a longint, in the example as C_LONGINT(eaEdtCol), the Area ID.

The default palette shown is the 4D color palette, but the palette can be changed by calling CADSetItemColor. 4D CAD accepts 16-million colors, which is more than there are on the color palette. When an actual color value is not found on the palette, for example for an object that was imported from a DXF file, you can best change the last color on the palette to hold the actual color value (the last color is by default black and the last color on the first row is black also).

The whole color palette can be dimmed with CADSetColorsDim, to indicate that it is not enterable.

Related methods
CADGetColorItem, CADSetColorItem, CADGetItemColor, CADSetItemColor, CADGetColorsDim, CADSetColorsDim, CADIndexToColor, CADColorToIndex, CADRGBToColor, CADColorToRGB, CADDXFToColor, CADColorToDXF, CADBlendColor.