gpColorSchemes - Examples

The following example displays the 34 preset color schemes stored in the gpColorSchemes Class. To use the gpColorSchemes class with the gpShapes class, simply remove the bgColor, borderColor, and borderSize options from the XML attributes and replace them with color scheme preset name of your choice.

< pStyles cType="shape1" nW="200" nH="100" shape_type="rectangle" corners="7,7,7,7" colorSchemeName="gpLimeGreen4" />

To use the gpColorSchemes class independently of the gpShapes class:

import flash.display.Sprite;
import com.grasshopper.utils.*;

var cScheme:gpColorSchemes = new gpColorSchemes('gpDarkGrey4', false);
var colorScheme:Object = cScheme.getColorScheme();

var sp:Sprite = new Sprite();
sp.x = 100;
sp.y = 100;

var matrix = new Matrix();
matrix.createGradientBox(100, 50, Math.PI/2, 0, 0);, colorScheme.bgColor, colorScheme.cAlphas, colorScheme.ratio, matrix);, colorScheme.brdrColor, 1.0);, 0, 100, 50);

For documentation about the gpColorSchemes Class, view the blog post.


, , , , , ,