One-com / one-color

An OO-based JavaScript color parser/computation toolkit with support for RGB, HSV, HSL, CMYK, and alpha channels. Conversion between color spaces occurs implicitly, and all methods return new objects rather than mutating existing instances. Works in the browser and node.js.
Other
536 stars 40 forks source link

add a note on the readme that it requires es5shim to run on IE7 #11

Closed marianoguerra closed 12 years ago

marianoguerra commented 12 years ago

hi!

it took me some time given the limited dev resources on IE7 to figure out that one-color doesn't work on it because it uses stuff like Array.forEach and Array.map, it would be nice to have a note on the README explaining that in order to run it in older browsers something like es5shim is required (https://github.com/kriskowal/es5-shim)

thanks for the lib!

papandreou commented 12 years ago

I agree, that's an annoying wtf, it should just work out of the box. Would be even better to polyfill map and forEach ourselves, or not rely on them. @munter, what do you think?

Munter commented 12 years ago

Since it's marketed as a microlib without dependencies I think we should polyfill, maybe with a seperate IE polyfill file if people don't wan't the overhead

Munter commented 12 years ago

How about this?

marianoguerra commented 12 years ago

I like the approach but it doesn't work since forEach and map require bind to be present and the lib also uses filter

here is a gist with the minimal shim I could get to make it run

Munter commented 12 years ago

Serves me right for not testing :P

I'll make it work properly in a few hours when I'm off work. This time with actual IE testing :D