VS:IsUserColor

From Vectorworks Developer
Jump to: navigation, search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Returns True if the color is a user color.
FUNCTION IsUserColor(
ColorIDX  :INTEGER;
VAR ColorName  :DYNARRAY[] OF CHAR) : BOOLEAN;
def vs.IsUserColor(ColorIDX):
    return (BOOLEAN, ColorName)

Parameters

ColorIDX INTEGER
ColorName DYNARRAY[] of CHAR

Remarks

ColorName returns the name of the color associated with the ColorIDX

Example

VectorScript

PROCEDURE PaintTagWorking;
VAR
obHd : HANDLE;
x, y : REAL;
colorIDX :INTEGER;
colorName : DYNARRAY[] OF CHAR;
ok : BOOLEAN;
red, green, blue : LONGINT;

BEGIN
obHd := LSActLayer;
ALLOCATE ColorName[1..32767];
WHILE NOT(obHd=NIL) DO BEGIN
GetFillBack(obHd, red, green, blue);
RGBToColorIndex(red, green, blue, colorIDX);
ok := IsUserColor(colorIDX, colorName);
IF ok THEN BEGIN
HCenter(obHd, x, y);
TextOrigin(x, y);
CreateText(colorName);
END;
obHd := PrevSObj(obHd);
END;
END;
RUN(PaintTagWorking);

Python


Version

Availability: from VectorWorks13.0
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox