harthur/color — pull request #14 by parshap (2013-10-17 07:12:34+00:00)
Title: Add `clone()` function to create a copy of the color object

I needed to create a copy of an existing color so that I can manipulate it to create a new color but still leave the original base color alone so that it can be used again later. I added a `color.clone()` function to return a new color object with the same values as the original.

This function uses `this.rgb()` to "serialize" the color object and pass
it to the Color constructor to create a new color object with values
equal to the original.

The new function is documented in the readme.

There are tests to make sure the values of the cloned object match the
original and that if the cloned object is manipulated the original
object does not change.