EMS.Gradient

Color gradient with a start and end color.  This also defines some default color gradients.

Summary
EMS.GradientColor gradient with a start and end color.
Properties
start{EMS.Color}
end{EMS.Color}
Constructor
EMS.Gradient
Functions
equals
clone{EMS.Gradient} Returns a clone of this gradient.
Static Functions
getGradientStatic method for getting a named gradient.
Constants
BLUEBlue gradient.
GREENGreen gradient.
PURPLEPurple gradient.
BROWNBrown gradient.
REDRed gradient.

Properties

start

Constructor

EMS.Gradient

Examples

var redToWhite = new Gradient(EMS.Color.RED, EMS.Color.WHITE);
var whiteToGrey = new Gradient("FFFFFF", new EMS.Color("CCCCCC"));
var whiteToBlack = new Gradient(["FFFFFF", new EMS.Color("000000"));

Parameters

colors{Mixed} can be two separate arguments which can be taken as inputs to EMS.Color or a single argument of either an {Array} or an {Object} with a start and end property.  In the case of an {Array} it will use the first item as the start and last item the end color.  All others are disregarded.

Functions

equals

equals: function(gradient)

Parameters

gradient{Mixed} is either an EMS.Gradient or {Object} to test for equality.

Returns

{Boolean} Returns true if the input gradient equals this gradient.

clone

clone: function()

Returns

{EMS.Gradient} Returns a clone of this gradient.

Static Functions

getGradient

EMS.Gradient.getGradient = function(gradient)

Static method for getting a named gradient.

Parameters

gradient{String} is the name of the gradient to try and find.

Returns

{EMS.Gradient} if there is a gradient by the given name, otherwise it will return null.

Constants

BLUE

Blue gradient.

GREEN

Green gradient.

PURPLE

Purple gradient.

BROWN

Brown gradient.

RED

Red gradient.

equals: function(gradient)
clone: function()
{EMS.Gradient} Returns a clone of this gradient.
EMS.Gradient.getGradient = function(gradient)
Static method for getting a named gradient.
Close