HTML5 Canvas 2D Library

color Library Method

Short Description: Set color / color animation

Signature: t.color (c,c1)
Group: Texture
Class: transition Class

Fills the animated object with the given color c. If c1 is given, this performs an animation changing the color from c to c1. Color values are strings that form a valid canvas fillStyle. Colors may be partially transparent. Default color is "fully transparent".

The method also sets the alpha value to 0 so that a texture is not visible, just the color given. If, however, alpha or blend is used afterwards, the color method actuall acts like bgColor.


The methods color, bgColor, lightAmbDiff, and lightBgAmbDiff are mutually exclusive, only one of them can be used for a single transition. This color method has the advantage that a color animation in the background color can be performed. On the other hand default values for the ambient and diffuse lighting factors will be used, as specified in taccgl.Lighting Parameters. Alternatively you can use lightBgAmbDiff which allows to set the background color and values for the ambient and diffuse lighting factors.

Next Page:transition.bgColor - Set background color / color animation
Previous Page: transition.alloc - Allocate Space on Texture Atlas