node-getcolor
v1.3.1
Published
Tool for get colors
Downloads
28
Readme
GetColor
Advantages:
- Huge data HEX and RGB colors
- Simple and fast interaction
- Small size packet NPM
Installing:
Using npm:
npm i node-getcolor
Connect this module in code, indicate module
const colors = require('node-getcolor');
How to write random color selection?
const colors = require('node-getcolor');
const randomColor = colors.getRandomColor();
// Get name of color
console.log(randomColor.name);
// Console: celadon
// You can get code of color
console.log(randomColor.code);
// Console: #7fffd4
// Or all data
console.log(`Name: ${randomColor.name} | Code: ${randomColor.code}`);
// Console: Name: aquamarine | Code: #7fffd4
How to choose a specific color?
const colors = require('node-getcolor');
// Color name must be written in lower case
console.log(colors.getHexColor('lime'));
// Console: #7fffd4
// You can get name of color by HEX-code
console.log(colors.getNameColor('#ffffff'));
// Console: White
// Get color in RGB format
console.log(colors.getRGBColor('red'));
// Console: [ 255, 0, 0, 1 ]