version 6.0
DR COLOR TO RGB (color; red; green; blue)
Parameter | Type | Description | |
color | Integer | Color | |
red | Longint | Red value | |
green | Longint | Green value | |
blue | Longint | Blue value |
Description
The command DR COLOR TO RGB maps the color defined by color into its three components: red, green, and blue.
color is an internal number used by 4D Draw and can be obtained through the functions DR RGB to color, DR Index to color, DR GET FILL ATTRIBUTES, and DR GET LINE ATTRIBUTES.
On Mac OS, the obtained values are the same as the System Chromatic Wheel (Color Picker). On Windows, they are the same as the custom color selector values multiplied by 256.
Example
The following example gets the fill color of the selected objects and then breaks it down into its three components.
DR GET FILL ATTRIBUTES (Area;0;$Pattern;$Color) DR COLOR TO RGB ($Color;$Red;$Green;$Blue)
See Also