Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bybenpuls/node-getcolor
Tool for get color
https://github.com/bybenpuls/node-getcolor
colors js nodejs npm
Last synced: about 2 months ago
JSON representation
Tool for get color
- Host: GitHub
- URL: https://github.com/bybenpuls/node-getcolor
- Owner: byBenPuls
- Created: 2023-08-17T14:17:48.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-19T20:19:51.000Z (over 1 year ago)
- Last Synced: 2024-04-24T16:48:03.359Z (9 months ago)
- Topics: colors, js, nodejs, npm
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/node-getcolor
- Size: 120 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# GetColor
[![NPM](https://nodei.co/npm/node-getcolor.png?mini=true)](https://nodei.co/npm/node-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?
```javascript
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?
```javascript
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](https://t.me/hex_rgb_color_bot)### [Donate link](https://yoomoney.ru/transfer/quickpay?requestId=353336363035363832365f62313031313938616234313235363132636364346436393865336436376637623663383937656131) | [My GitHub](https://github.com/byBenPuls) | [NPM](https://www.npmjs.com/package/node-getcolor)
[![NPM](https://nodei.co/npm/node-getcolor.png)](https://nodei.co/npm/node-getcolor/)
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=byBenPuls&repo=node-getcolor)](https://github.com/byBenPuls/node-getcolor)