PROCEDURE GetGradientDataN(
gradient : HANDLE;
segmentIndex : INTEGER;
VAR spotPosition : REAL;
VAR midpointPosition : REAL;
VAR red : LONGINT;
VAR green : LONGINT;
VAR blue : LONGINT;
VAR opacity : INTEGER);def vs.GetGradientDataN(gradient, segmentIndex):
return (Boolean, spotPosition, midpointPosition, red, green, blue, opacity)| Name | Type | Description |
|---|---|---|
| gradient | HANDLE | Gradient that contains the segment. |
| segmentIndex | INTEGER | Segment from which to get the data. |
| spotPosition | REAL | Position of the segment's color spot relative to left-most point of the gradient. |
| midpointPosition | REAL | Position of the segment's midpoint relative to color spot immediately to left. |
| red | LONGINT | Red component of the color spot's color. |
| green | LONGINT | Green component of the color spot's color. |
| blue | LONGINT | Blue component of the color spot's color. |
| opacity | INTEGER | Opacity of the color spot. |
PROCEDURE Example;
VAR
gradient :HANDLE;
segmentIndex :INTEGER;
spotPosition, midpointPosition :REAL;
red, green, blue :LONGINT;
opacity :INTEGER
BEGIN
gradient := GetObject('Cyan-Magenta-Yellow');
segmentIndex := 3;
GetGradientData(gradient, segmentIndex, spotPosition, midpointPosition, red, green, blue.opacity);
Message(red, ' ', green, ' ', blue, ' ', opacity);
END;
RUN(Example);GetGradientDataN(gradient, 1, 1.0, 2.0, 2, 3, 10, 5);import vs
gradient = vs.FSActLayer() # handle to the first selected object on the active layer
segmentIndex = 1
ok, spotPosition, midpointPosition, red, green, blue, opacity = vs.GetGradientDataN(gradient, segmentIndex)
vs.Message('GetGradientDataN returned: ' + str((ok, spotPosition, midpointPosition, red, green, blue, opacity)))VS Functions: SetGradientDataN | InsertGradientData
Availability: from Vectorworks 2015