Permalink
Browse files

added ./test [colors] support

  • Loading branch information...
1 parent 69f0bd9 commit c41bb2e218d7e3a2829d0af3038eb5c961ede618 @tj committed Dec 18, 2011
Showing with 3 additions and 2 deletions.
  1. BIN examples/learnboost.jpg
  2. +3 −2 test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -7,10 +7,11 @@ var palette = require('./')
, canvas = new Canvas
, ctx = canvas.getContext('2d')
, path = process.argv[2]
+ , n = ~~process.argv[3] || 5
, out = '/tmp/out.png';
if (!path) {
- console.error('Usage: test <image>');
+ console.error('Usage: test <image> [colors]');
process.exit(1);
}
@@ -30,7 +31,7 @@ img.src = path;
function paintPalette() {
var x = 0;
- var colors = palette(canvas);
+ var colors = palette(canvas, n);
colors.forEach(function(color){
var r = color[0]
, g = color[1]

0 comments on commit c41bb2e

Please sign in to comment.