Skip to content
 
 

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ]

Usage example:

Telegram

Readme Card

About

Tool for get color

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages