Closed benekastah closed 8 years ago
Yeah, looks like inputToRgb
should make a clone of the input if it's an object: https://github.com/bgrins/TinyColor/blob/f7cd274b12f0aaecb974270632b24d0200175b97/tinycolor.js#L300
Yes please. This makes the API very painful to use as it stands, as you have to clone input at every call site to ensure that they don't get mutated
+1
I was shocked to find that even new tinycolor(old)
doesn't make a copy.
👍 Ran into this and was majorly hard to track down what was breaking.
Would anyone like to take this on?
If I get a chance this weekend I'll work up a PR.
If I get a chance this weekend I'll work up a PR
thanks!
Currently the tinycolor constructor actually modifies input objects:
I spent a while trying to figure out why I was getting
NaN
s in my app :)