PV COLOR TO RGB
version 6.8
PV COLOR TO RGB (color; red; green; blue)
Parameter | Type | Description | |
color | Longint | Color | |
red | Integer | Red component (0 to 255) | |
green | Integer | Green component (0 to 255) | |
blue | Integer | Blue component (0 to 255) |
Description
The PV COLOR TO RGB command returns, in the red, green and blue parameters, the three RGB components of color.
Refer to the description of the 4D command SET RGB COLORS for detailed information on the color system used by 4D.
Example
Display the three RGB components of the background color of cell A1:
C_LONGINT($Color)
C_INTEGER($Red;$Green;$Blue)
PV SET CELL STRING VALUE (Area;2;1;"Color") `Labels
PV SET CELL STRING VALUE (Area;2;2;"Red")
PV SET CELL STRING VALUE (Area;2;3;"Green")
PV SET CELL STRING VALUE (Area;2;4;"Blue")
$Color:=PV Get cell property (Area;1;1;pv style color back odd )
PV COLOR TO RGB ($Color;$Red;$Green;$Blue)
PV SET CELL NUM VALUE (Area;1;2;$Red) `Values
PV SET CELL NUM VALUE (Area;1;3;$Green)
PV SET CELL NUM VALUE (Area;1;4;$Blue)
See Also