Permalink
Browse files

misc

  • Loading branch information...
1 parent 58b3661 commit 439a8049cda00d3a0e167b429718393de91a098d @tj committed Dec 18, 2011
Showing with 9 additions and 4 deletions.
  1. +1 −1 lib/palette.js
  2. +8 −3 test
View
@@ -25,7 +25,7 @@ exports.version = '0.0.1';
/**
* Return the color palette for the given `canvas`
- * consisting of `n` color values, defaulting to 5.
+ * consisting of `n` RGB color values, defaulting to 5.
*
* @param {Canvas} canvas
* @param {Number} n
View
11 test
@@ -23,10 +23,15 @@ img.onload = function(){
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(img, 0, 0);
var colors = palette(canvas);
+ console.log(colors);
+ save();
+};
+
+img.src = path;
+
+function save() {
fs.writeFile(out, canvas.toBuffer(), function(err){
if (err) throw err;
console.log('saved %s', out);
});
-};
-
-img.src = path;
+}

0 comments on commit 439a804

Please sign in to comment.