About Color Transformation Objects:

A Color Transformation Object is merely a way to store related pieces of color information. A Color Transform Object generally contains 8 pieces of information; an A and B value for red, an A and B for green, an A and B for blue and an A and B for alpha. They are referred to as ra, rb, ga, gb, ba, bb, aa and ab. The A Group of variables generally go from -100% to 100% but can go beyond those limits if desired. The A Group variables are multiplied by the pixels initial color value. The B Group of variables usually range from -255 to 255 but can also go beyond these limits. The B Group is added to the initial value which was multiplied by the A Group.

Imagine you are transforming the color of a single pixel image. Imagine this single pixel's initial color is our familiar friend ORANGE (r:255, g:128, b:0). Imagine we are going to use the following transformation object to change our single pixel image {ra:50, rb:-100, ga:25, gb:100, ba:100, bb:200, aa:100, ab:0}. This is how you can calculate the final color of your pixel:

<<A>>     <<B>>
component = init value * percent + offset = final value
        r =        255 *   .50   -   100  = 227.5
        g =        128 *   .25   +   100  = 132
        b =          0 *  1.00   +   200  = 200
        a =        255 *  1.00   +     0  = 255

So our ORANGE {r:255, g:128, b:0, a:255} will now be show up as what I'd call a light pink {r:227, g:132, b:200, a:255} after applying the Color Transform Object. Just remember A Group multiplies, B Group adds.

(transObjSame)

Color.prototype.transObjSame = function (obj1, obj2){
        for(var i in obj1){
                if(obj1[i] != obj2[i]){
                        return false;
                }
        }
        return true;
}

Purpose:
The transObjSame function is used to make sure we don't try to fade from one color to the same color. It's like fading from red to the exact same shade of red, there's not much point to it.

Explanation:
TransObjSame compares two different objects to see if all the properties within the first object are reflected in the second object.

Consider object1={ra:100, rb:150} and object2={ra:100, rb:150, ga:50, gb:50}. The function transObjSame goes through every property in object1 making sure it is represented in object2. There is a 'ra' property in object1 and there's a 'ra' property in object2. Both are equal so the function does NOT return false, instead it moves to the next property in object 1 and checks to see if it is reflected in object2. If it is not reflected the function returns false. If the function manages to go through all properties in object1 without returning false then the function returns a value of true meaning there's no difference in the values the objects hold. So in our example Object1 would be considered the "same" as Object2.