76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Adds support for color properties in <code>to</code>
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * and <code>from</code> attributes.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @module anim
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @submodule anim-color
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glassvar NUM = Number;
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass set: function(anim, att, from, to, elapsed, duration, fn) {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass if (!from || from.length < 3 || !to || to.length < 3) {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass Y.error('invalid from or to passed to color behavior');
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass Math.floor(fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)),
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass Math.floor(fn(elapsed, NUM(from[2]), NUM(to[2]) - NUM(from[2]), duration)),
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass Math.floor(fn(elapsed, NUM(from[3]), NUM(to[3]) - NUM(from[3]), duration))
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // TODO: default bgcolor const
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val;
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass 'borderColor',
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass 'borderTopColor',
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass 'borderRightColor',
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass 'borderBottomColor',
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass 'borderLeftColor'],
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass function(v, i) {