Procedure RGBToColorIndex converts the VectorWorks palette colors from its' red, green, and blue component values to the colors' palette position index. Parameters red, green, and blue return the color components of the swatch, and parameter color is the palette position ID of the color swatch. RGB values are in the range of 0~65535.
A color table listing with associated index values can be found in the [[VS:Function Reference Appendix#Color Palette|Appendix]].
PROCEDURE RGBToColorIndex(
red : LONGINT;
green : LONGINT;
blue : LONGINT;
VAR color : INTEGER);def vs.RGBToColorIndex(red, green, blue):
return color| Name | Type | Description |
|---|---|---|
| red | LONGINT | RGB color component value. |
| green | LONGINT | RGB color component value. |
| blue | LONGINT | RGB color component value. |
| color | INTEGER | Color index. |
See <a href=http://www.vectorlab.info/index.php?title=Colors_in_VectorWorks_2008%2B>VectorLab</a> for more info on color indices in VectorWorks 2008.
lectandDelObjects}}
Functions:
- ColorIndexToRGB| ColorIndexToRGB
- ColorIndexToRGBN| ColorIndexToRGBN
- RGBToColorIndexN| RGBToColorIndexN
Availability: from MiniCAD6.0
- Utility