bgrins / TinyColor

Fast, small color manipulation and conversion for JavaScript
https://bgrins.github.io/TinyColor/
MIT License
5.08k stars 438 forks source link

Copy or clone color #84

Closed hackhat closed 9 years ago

hackhat commented 9 years ago

I would like to copy or clone a color so any changes will not mess the source.

bgrins commented 9 years ago

Hello, you should be able to call tinycolor(originalColor.toString()). I've added a note to the documentation about this: https://github.com/bgrins/TinyColor#cloning

hackhat commented 9 years ago

Yes, this is the current method I'm using. But using like this would be better myColor.clone() than that. I can make a pull request if interested.

bgrins commented 9 years ago

OK, sure! Can you add an instance method for clone and also add a new test function for it after the "Original input" function?

bgrins commented 9 years ago

Closed by #105