Skip to content
Reference > Classes

ColorGradient

Definition

ColorGradient var = .... ;

Extends

Extended By

None

Description

An immutable color gradient, represented by a series of color stops order by the stop value.

Method Summary

Owner Name Return Type Description
ColorGradient constructor(gradient) ColorGradient Construct a new Color Gradient.
Object getClassName() String Returns the string name of this object's class type.
ColorGradient getStopColor(index) String Returns the color at the specified index.
ColorGradient getStopValue(index) String Returns the stop value at the specified index.
ColorGradient getStopsCount() String Returns the number of color stops, typically there should be at least two.
ColorGradient toColor(value) String Returns the color hexcode associated with the supplied value.
Object toJson() String Returns a json representation of this object.

Method Definitions


constructor(gradient)

ColorGradient colorgradient = new ColorGradient(String gradient)

Description

Construct a new Color Gradient.

Parameter Definition

Name Type Description
gradient String  num:color,num:color

getStopColor(index)

String ColorGradient::getStopColor(Number index)

Description

Returns the color at the specified index.

Parameter Definition

Name Type Description
index Number  zero-based index

getStopValue(index)

String ColorGradient::getStopValue(Number index)

Description

Returns the stop value at the specified index.

Parameter Definition

Name Type Description
index Number  zero-based index

getStopsCount()

String ColorGradient::getStopsCount()

Description

Returns the number of color stops, typically there should be at least two.


toColor(value)

String ColorGradient::toColor(Number value)

Description

Returns the color hexcode associated with the supplied value.

Parameter Definition

Name Type Description
value Number