VS:CreateGradient

From Vectorworks Developer
Revision as of 21:50, 27 April 2008 by Root (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.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