Skip to content

Commit

Permalink
added ./test [colors] support
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Dec 18, 2011
1 parent 69f0bd9 commit c41bb2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Binary file added examples/learnboost.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions test
Expand Up @@ -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);
}

Expand All @@ -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]
Expand Down

0 comments on commit c41bb2e

Please sign in to comment.