moagrius / Color

abstract Color management class for JavaScript; discreet component manipulation; output formatting; conversions.
http://moagrius.github.io/Color/Color.html
MIT License
21 stars 9 forks source link

parse rgb string doesn't work #5

Closed getriebesand closed 8 years ago

getriebesand commented 8 years ago

In parse(value) if value is a rgb string, function p2v returns a string, but number is required for absround() later in format functions.

change var p2v = function(p){ return isPercent.test(p) ? absround(parseInt(p) * 2.55) : p; }; to var p2v = function(p){ return isPercent.test(p) ? absround(parseInt(p) * 2.55) : parseInt(p); }; will fix this issue

moagrius commented 8 years ago

awesome, thanks, will commit the change when i have some time

moagrius commented 8 years ago

fixed in https://github.com/moagrius/Color/pull/6