



NOTICE

The “Activate semi-transparent drawing” option is provided in the ⮫ “Object: Visualization Manager ”, ⮫ Further information. This option is enabled by default so that the “Transparency” property is available for all color definitions. With a programmatic color definition, the leading byte is interpreted as an alpha channel and therefore used as the transparency value of the color. When the option is cleared, the “Transparency” property is not available and the leading byte is ignored in color literals.
Color information in the code is specified as DWORD
literals. The value is in the RGBA color space and is usually shown as a hexadecimal
number. The value is coded with additive portions of red, green, and blue. It is appended
with the alpha channel which determines the transparency of the color.
Byte order of a color literal
16#<TT><RR><GG><BB> <TT> : 00 - FF // Transparency in 256 levels <RR> : 00 - FF // Red in 256 levels <GG> : 00 - FF // Green in 256 levels <BB> : 00 - FF // Blue in 256 levels
The graduation value for transparency is 16#FF
for opaque and 16#00
for transparent. For each color portion, one byte is reserved for 256 color graduations
16#FF
to 16#00
. 16#FF
means 100% color portion and 16#00
means 0% color portion.
|
Byte for the transparent graduation of |
|
Byte for the red portion of |
|
Byte for the green portion of |
|
Byte for the blue portion of |
Example
|
Blue, opaque |
|
Green, opaque |
|
Yellow. opaque |
|
Gray, semitransparent |
|
Black, semitransparent |
|
Red, opaque |
Example
Global declaration of color constants