jeremyckahn / shifty

The fastest TypeScript animation engine on the web
https://jeremyckahn.github.io/shifty/doc/
MIT License
1.54k stars 88 forks source link

Color plugin fails if there is whitespace in the string #6

Closed joelambert closed 13 years ago

joelambert commented 13 years ago

The color outputted isn't a valid string when there is whitespace in the input string.

e.g.

from: { color: 'rgb(0, 0, 255);  }
to: { color: 'rgb(255, 0, 0); }

The output is either NaN or NaNrgb(255, 0, 0)

This is an issue as its how WebKit browsers format the colour param of an element. I suspect this should be an easy fix, just clean the string on initialisation?

string.replace(/\s/g, '');
jeremyckahn commented 13 years ago

Fixed in SHA: a79f2ea1b05af3694bc7a79f919bd740b5756b89