The creation, blending, and application of colors to shapes and text is a common task performed in all Omni applications. This page details how to work with color values in various color spaces.

Color Functions

Here’s a script example that creates a green circle (in the RGB color space) with a 50% transparency (alpha value) overlaid on a blue square:

cnvs =[0].selection.canvas square = cnvs.addShape('Rectangle',new Rect(72,72,200,200)) square.fillColor = Color.RGB(0, 0, 1, 1) circle = cnvs.addShape('Circle',new Rect(150,150,200,200)) circle.fillColor = Color.RGB(0, 1, 0, 0.5)

Here’s a script example that adds grayscale tint swatches, from black to white in increments of 10%, to the current canvas:

cnvs =[0].selection.canvas objSize = 48 offset = 0 swatches = new Array() for(i = 0; i < 11; i++){ offset = offset + objSize aRect = new Rect(offset, objSize, objSize, objSize) graphic = cnvs.addShape('Square', aRect) color = Color.White(i*.1,1) graphic.fillColor = color swatches.push(graphic) } swatchStrip = new Group(swatches)

Color Class Properties

Some common colors can be represented with the following property values instead of using one of the Color methods.

Color Instance Properties

Once a Color object has been created, you can use the following instance properties to gather information about the color object.

Color Instance Functions

Color objects can be blended to create new colors, using the blend() method:

cnvs =[0].selection.canvas graphic = cnvs.addShape('Circle',new Rect(0,0,200,200)) colorA = colorB = Color.yellow blendColor = colorA.blend(colorB,0.5) graphic.fillColor = blendColor

Here’s an example of blending colors: creating an orange circle by blending red and yellow



Curabitur blandit tempus porttitor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Etiam porta sem malesuada magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.


This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.