misund / hex-to-rgba

Converts CSS hexadecimal color codes to rgba().

Home Page:https://www.npmjs.com/package/hex-to-rgba

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work in IE11

eltonjuan opened this issue · comments

Not sure what you're targeting as far as browser support but the following line blows up in IE11:

const removeHash = hex => (hex.startsWith('#') ? hex.slice(1) : hex);

This is because String.prototype.startsWith isn't supported as shown in this table: http://kangax.github.io/compat-table/es6/#test-String.prototype.startsWith

Opened PR #9 to address this issue.

Thanks for pointing this out - I've only used this in projects with polyfills on the client side, so I never encountered the issue myself.