VS:InsertGradientSegment

From Vectorworks Developer
Jump to navigation Jump to search

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

Description

Inserts a new segment into the gradient and initializes its data to the specified values.

A segment consists of a single color spot and the single midpoint immediately to the right of the color spot.

FUNCTION InsertGradientSegment(
gradient :HANDLE;
spotPosition :REAL;
midpointPosition :REAL;
red :LONGINT;
green :LONGINT;
blue :LONGINT) : INTEGER;
def vs.InsertGradientSegment(gradient, spotPosition, midpointPosition, red, green, blue):
    return INTEGER

Parameters

gradient HANDLE Gradient into which a segment is to be inserted.
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.

Return Value

Returns the index of the newly created segment; 0 otherwise.

Note: segment indexes begin with 1.

Example

VectorScript

index := InsertGradientSegment(gradientHandle, 0.35, 0.4, 255, 255, 255);
{ inserts a white color spot at position, 0.35, with a midpoint position of 0.4 }

Python


Version

Availability: from VectorWorks10.0