VS:CreateGradient
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Creates a new gradient resource.
FUNCTION CreateGradient(
name :STRING) : HANDLE;
def vs.CreateGradient(name): return HANDLE
Parameters
name STRING A user-specified name by which the newly created gradient will be identified.
Return Value
Returns a handle to a new gradient resource if successful, otherwise the function returns nil.
Remarks
This function creates a default gradient with 2 color spots: a white color spot at position, 0.0, and a black color spot at position, 1.0.
A gradient resource must always have at least 2, but no more than 32767 color spots. NOTE: if the specified name already exists, a unique nmae will be created by adding a number suffix to the specified name.
Example
VectorScript
gradientHandle := CreateGradient('My Gradient');
Python
vs.Message(vs.CreateGradient('My Gradient'))
Version
Availability: from VectorWorks10.0