VS:ColorIndexToRGB: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
mNo edit summary |
||
Line 5: | Line 5: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<desc> | <desc> | ||
Procedure ColorIndexToRGB converts the VectorWorks palette colors from the colors' palette position index to its red, green, and blue component values. RGB values are in the range of 0~65535. | Procedure ColorIndexToRGB converts the VectorWorks palette colors from the colors' palette position index to its red, green, and blue component values. | ||
RGB values are in the range of 0~65535. (Black: (0, 0, 0), White: (65535, 65535, 65535)) | |||
A color table listing with associated index values can be found in the [[VS:Function_Reference_Appendix#Color_Palette| Appendix]] | A color table listing with associated index values can be found in the [[VS:Function_Reference_Appendix#Color_Palette| Appendix]] | ||
Line 71: | Line 72: | ||
* [[VS:RGBToColorIndex| RGBToColorIndex]] | * [[VS:RGBToColorIndex| RGBToColorIndex]] | ||
* [[VS:RGBToColorIndexN| RGBToColorIndexN]] | * [[VS:RGBToColorIndexN| RGBToColorIndexN]] | ||
* [[VS:GetPenFore]] | [[VS:GetPenBack]]| [[VS:GetFillFore]] | [[VS:GetFillBack]] | |||
</seeAlso> | </seeAlso> | ||
Latest revision as of 11:41, 14 October 2021
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Procedure ColorIndexToRGB converts the VectorWorks palette colors from the colors' palette position index to its red, green, and blue component values.
RGB values are in the range of 0~65535. (Black: (0, 0, 0), White: (65535, 65535, 65535))
A color table listing with associated index values can be found in the Appendix
PROCEDURE ColorIndexToRGB(
color :INTEGER;
VAR red :LONGINT;
VAR green :LONGINT;
VAR blue :LONGINT);
def vs.ColorIndexToRGB(color): return (red, green, blue)
Parameters
color INTEGER Color index. red LONGINT RGB color component value. green LONGINT RGB color component value. blue LONGINT RGB color component value.
Example
VectorScript
ColorIndexToRGB(45, r, g, b); {returns the color value components of the color at position 45}
Python
r, g, b = vs.ColorIndexToRGB(45)
Version
Availability: from MiniCAD 6.0
See Also
Functions:
- ColorIndexToRGBN
- RGBToColorIndex
- RGBToColorIndexN
- VS:GetPenFore | VS:GetPenBack| VS:GetFillFore | VS:GetFillBack
Functions:
- [[VS:ColorIndexToRGBN| ColorIndexToRGBN]]
- [[VS:RGBToColorIndex| RGBToColorIndex]]
- [[VS:RGBToColorIndexN| RGBToColorIndexN]]
- [[VS:GetPenFore]] | [[VS:GetPenBack]]| [[VS:GetFillFore]] | [[VS:GetFillBack]]