# Yahoo! UI Library

### animation 2.5.0

Yahoo! UI Library > animation > YAHOO.util.ColorAnim

Show Private Show Protected

## Class YAHOO.util.ColorAnim - extends YAHOO.util.Anim

Known Subclasses:
  YAHOO.util.Motion YAHOO.util.Scroll

Anim subclass for color transitions.

Usage: `var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);` Color values can be specified with either 112233, #112233, [255,255,255], or rgb(255,255,255)

### Constructor

YAHOO.util.ColorAnim `( el , attributes , duration , method )`

Parameters:
  `el <HTMLElement | String>` Reference to the element that will be animated
  `attributes <Object>` The attribute(s) to be animated. Each attribute is an object with at minimum a "to" or "by" member defined. Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). All attribute names use camelCase.
  `duration <Number>` (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
  `method <Function>` (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)

#### Properties inherited from YAHOO.util.Anim:

`_onComplete, _onStart, _onTween, actualFrames, attributes, currentFrame, duration, el, isAnimated, method, startTime, totalFrames, useSeconds`

### Methods

#### parseColor

`Array parseColor ( s )`
Attempts to parse the given string and return a 3-tuple.

Parameters:
  `s <String>` The string to parse.

Returns: `Array`
  The 3-tuple of rgb values.

#### Methods inherited from YAHOO.util.Anim:

`animate, doMethod, getAttribute, getDefaultUnit, getEl, getStartTime, init, isAnimated, onTween, setAttribute, setEl, setRuntimeAttribute, stop, toString`

#### Events inherited from YAHOO.util.Anim:

`onComplete, onStart, onTween,`

Copyright © 2007 Yahoo! Inc. All rights reserved.