diff options
| author | Jules Laplace <jules@okfoc.us> | 2013-03-03 18:04:09 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2013-03-03 18:04:09 -0500 |
| commit | 4dfa8d9dc602e11bf335d289ae7717f408403ca0 (patch) | |
| tree | 2b5df1270c92d484076e2b8798c379945efe5b2e /public/js | |
| parent | 02d7f7ec672b4c5644e4ab530cf11df4eb0ec289 (diff) | |
mask and colorize superpaint patterns
Diffstat (limited to 'public/js')
| -rw-r--r-- | public/js/color.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/public/js/color.js b/public/js/color.js index 85fe95d..579ed5e 100644 --- a/public/js/color.js +++ b/public/js/color.js @@ -31,6 +31,15 @@ Color.prototype.alpha = function(a){ c.a = a; return c; } +Color.prototype.swatch = function(){ + var el = document.createElement("div"); + el.style.className = "swatch"; + el.style.width = 16 + "px"; + el.style.height = 16 + "px"; + el.style.backgroundColor = this.toString(); + $(el).data("color", this); + return el; +} var colors = { red: new Color([ 255,0,0 ]), |
