4D v13

WR RGB to color

Home

 
4D Write v13
WR RGB to color

WR RGB to color 


 

WR RGB to color ( red ; green ; blue ) -> Function result 
Parameter Type   Description
red  Longint in Red component (0 to 65535)
green  Longint in Green component (0 to 65535)
blue  Longint in Blue component (0 to 65535)
Function result  Longint in Color

The WR RGB to color command returns a compact number that is used by 4D Write to manage colors. This number represents the three component colors: red, green, and blue. The red, green, and blue parameters are the same values used in your system’s color picker. These values range from 0 to 65535.

To obtain the following colors, you can write:

 RedColor:=WR RGB to color(56576;2048;1536)
  `You will get red
 GreenColor:=WR RGB to color(0;32768;4352)
  `You will get green
 BlueColor:=WR RGB to color(0;0;54272)
  `You will get blue
 CyanColor:=WR RGB to color(512;43776;59904)
  `You will get cyan
 MagentaColor:=WR RGB to color(64512;62208;1280)
  `You will get magenta
 YellowColor:=WR RGB to color(61952;2048;33792)
  `You will get yellow

The following example returns a color between two colors:

 WR COLOR TO RGB(c1;r1;g1;b1)
 WR COLOR TO RGB(c2;r2;g2;b2)
 c3:=WR RGB to color((r1+r2)/2;(g1+g2)/2;(b1+b2)/2)

 
PROPERTIES 

Product: 4D
Theme: WR Utilities
Number: 89170

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D Write 6