Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added ./test [colors] support

  • Loading branch information...
commit c41bb2e218d7e3a2829d0af3038eb5c961ede618 1 parent 69f0bd9
@tj authored
Showing with 3 additions and 2 deletions.
  1. BIN  examples/learnboost.jpg
  2. +3 −2 test
View
BIN  examples/learnboost.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
5 test
@@ -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]
Please sign in to comment.
Something went wrong with that request. Please try again.