Skip to content

Commit

Permalink
Adding testing script using chalk
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Apr 7, 2021
1 parent 3ed25d2 commit 9dbd6e7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions npm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"devDependencies": {
"@yomguithereal/eslint-config": "^4.0.0",
"chai": "^4.3.1",
"chalk": "^4.1.0",
"eslint": "^7.23.0",
"fs-extra": "^9.1.0",
"handlebars": "^4.7.7",
Expand Down
21 changes: 21 additions & 0 deletions npm/scripts/print.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var iwanthue = require('../');
var chalk = require('chalk');
var repeat = require('lodash/repeat')

var n = +process.argv[2];

var palette = iwanthue(n, {
clustering: 'k-means'
});

console.log();
console.log('Generating palette with ' + n + ' colors.');
console.log();

var line = repeat(' ', 30);

palette.forEach(function(color) {
console.log(chalk.bgHex(color)(line) + ' ' + color);
});

console.log();

0 comments on commit 9dbd6e7

Please sign in to comment.