Class YAHOO.util.ColorAnim

Object
   |
   +--YAHOO.util.Anim
         |
         +--YAHOO.util.ColorAnim
Direct Known Subclasses:
YAHOO.util.Motion, YAHOO.util.Scroll

class YAHOO.util.ColorAnim
extends YAHOO.util.Anim
Requires:
YAHOO.util.Anim
YAHOO.util.AnimMgr
YAHOO.util.Easing
YAHOO.util.Bezier
YAHOO.util.Dom
YAHOO.util.Event
YAHOO.util.CustomEvent

ColorAnim subclass for color fading.

Usage: var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);

Color values can be specified with 112233, #112233, #123, or rgb(255,255,255)

Method Summary [top]

Number doMethod (<String> attr, <Number> start, <Number> end)
Returns the value computed by the animation's "method". 
Number getAttribute (<String> attr)
Returns current value of the attribute. 
Array parseColor (<String> s)
Attempts to parse the given string and return a 3-tuple. 
String toString ()
toString method 

Constructor Detail [top]

YAHOO.util.ColorAnim

YAHOO.util.ColorAnim ()
Parameters:
HTMLElement - | String} el Reference to the element that will be animated
attributes - 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 - (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
method - (optional, defaults to Y.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a Y.Easing method)

Method Detail [top]

doMethod

Number doMethod (<String> attr, <Number> start, <Number> end)
Returns the value computed by the animation's "method".
Parameters:
attr - The name of the attribute.
start - The value this attribute should start from for this animation.
end - The value this attribute should end at for this animation.
Returns:
The Value to be applied to the attribute.

getAttribute

Number getAttribute (<String> attr)
Returns current value of the attribute.
Parameters:
attr - The name of the attribute.
Returns:
val The current value of the attribute.

parseColor

Array parseColor (<String> s)
Attempts to parse the given string and return a 3-tuple.
Parameters:
s - The string to parse.
Returns:
The 3-tuple of rgb values.

toString

String toString ()
toString method
Returns:
string represenation of anim obj