summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2013-03-03 18:04:09 -0500
committerJules Laplace <jules@okfoc.us>2013-03-03 18:04:09 -0500
commit4dfa8d9dc602e11bf335d289ae7717f408403ca0 (patch)
tree2b5df1270c92d484076e2b8798c379945efe5b2e /public/js
parent02d7f7ec672b4c5644e4ab530cf11df4eb0ec289 (diff)
mask and colorize superpaint patterns
Diffstat (limited to 'public/js')
-rw-r--r--public/js/color.js9
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 ]),