Skip to content

Commit

Permalink
Merge branch 'z38-pr-docs'
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrins committed Nov 8, 2015
2 parents 5bd5fd1 + c7b9e05 commit 0c95881
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Expand Up @@ -27,7 +27,7 @@ Then just include it in the page in a `script` tag:

Then it can be used in your script like so:

var tinycolor = require("./tinycolor");
var tinycolor = require("tinycolor2");
var color = tinycolor("red");

## Usage
Expand Down Expand Up @@ -453,12 +453,13 @@ See [index.html](https://github.com/bgrins/TinyColor/blob/master/index.html) in

## Common operations

### Cloning
### clone

To clone a color, you can simply instantiate a new tinycolor with the old one's `toString` output. The new color is a copy of the first one, so any changes to one won't affect the other. See this example:
`clone: function() -> TinyColor`.
Instantiate a new TinyColor object with the same color. Any changes to the new one won't affect the old one.

var color1 = tinycolor("#F00");
var color2 = tinycolor(color1.toString());
var color2 = color1.clone();
color2.setAlpha(.5);

color1.toString(); // "#ff0000"
Expand Down

0 comments on commit 0c95881

Please sign in to comment.