-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (23 loc) · 682 Bytes
/
index.js
File metadata and controls
27 lines (23 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { argv } from 'node:process';
import chalk from 'chalk';
import randomcolor from 'randomcolor';
const hue = argv[2];
const luminosity = argv[3];
const myColor = randomcolor({
luminosity: luminosity,
hue: hue,
});
const colorBox = chalk.hex(myColor);
function generateBox() {
const fullLines = Array(3).fill('#'.repeat(31)).join('\n') + '\n';
const halfLines = '#'.repeat(5) + ' '.repeat(21) + '#'.repeat(5) + '\n';
const middleLine =
'#'.repeat(5) +
' '.repeat(7) +
myColor +
' '.repeat(7) +
'#'.repeat(5) +
'\n';
return [fullLines, halfLines, middleLine, halfLines, fullLines].join('');
}
console.log(colorBox(generateBox(myColor)));