You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a CLI for this, which I think other people might find useful. I'm not at all familiar with node and Javascript. Should I create a new package and repo like https://github.com/chalk/chalk-cli does for chalk? Or should it be merged here?
#!/usr/bin/env node
// You can pipe the JSON output to `jq -re '.[]'` for easy consumption.constprogram=require('commander');varrandomColor=require('randomcolor');// import the scriptprogram.option('-u, --hue <hue>','Controls the hue of the generated color. You can pass a string representing a color name: red, orange, yellow, green, blue, purple, pink and monochrome are currently supported. If you pass a hexidecimal color string such as #00FFFF, randomColor will extract its hue value and use that to generate colors.','random');program.option('-l, --luminosity <luminosity>','Controls the luminosity of the generated color. You can specify a string containing bright, light or dark.','random');program.option('-c, --count <count>','An integer which specifies the number of colors to generate.','1');program.option('-s, --seed <seed>','An integer or string which when passed will cause randomColor to return the same color each time. The default value is generated using Math.random.',Math.random().toString());program.option('-f, --format <format>','A string which specifies the format of the generated color. Possible values are rgb, rgba, rgbArray, hsl, hsla, hslArray and hex.','rgb');program.option('-a, --alpha <alpha>',' A decimal between 0 and 1. Only relevant when using a format with an alpha channel (rgba and hsla).','1');program.parse(process.argv);console.log(JSON.stringify(randomColor({hue: program.hue,count: program.count,luminosity: program.luminosity,format: program.format,alpha: program.alpha,seed: program.seed})));
The text was updated successfully, but these errors were encountered:
Hello! Please create your own repo, distribute the CLI and I'd more than happy to accept a PR adding to a link to your project to this project's README
I have created a CLI for this, which I think other people might find useful. I'm not at all familiar with node and Javascript. Should I create a new package and repo like https://github.com/chalk/chalk-cli does for
chalk
? Or should it be merged here?The text was updated successfully, but these errors were encountered: