https://github.com/mcnaveen/node-rgb-to-hex
Simple utility to convert RGB Values to HEX color codes
https://github.com/mcnaveen/node-rgb-to-hex
color colors convert convertor hex node node-module nodejs nodejs-modules npm-package rgb yarnpkg
Last synced: 30 days ago
JSON representation
Simple utility to convert RGB Values to HEX color codes
- Host: GitHub
- URL: https://github.com/mcnaveen/node-rgb-to-hex
- Owner: mcnaveen
- Created: 2022-03-02T12:35:05.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-02T12:37:15.000Z (over 4 years ago)
- Last Synced: 2025-01-30T15:40:26.543Z (over 1 year ago)
- Topics: color, colors, convert, convertor, hex, node, node-module, nodejs, nodejs-modules, npm-package, rgb, yarnpkg
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/node-rgb-to-hex
- Size: 33.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Convert RGB to HEX
:unicorn: Simple utility to convert RGB Values to HEX color codes


### :package: Requirements
Node.js 12.x LTS or 14.x LTS
### :sparkles: Installation
Install the NPM Package with the below command:
```
npm install node-rgb-to-hex --save
```
(or)
Install with Yarn:
```
yarn add node-rgb-to-hex
```
### :pen: Usage
Import the module in your project:
```javascript
// Commonjs Import
var rgbToHex = require("node-rgb-to-hex");
// or ES6 import
import rgbToHex from "node-rgb-to-hex";
```
### :bulb: Example
Pass the RGB value to the function
```javascript
import rgbToHex from "node-rgb-to-hex";
const hex = rgbToHex(255, 255, 255)
console.log(hex);
```
### :ballot_box_with_check: Example Output
```
#ffffff
```
---
#### :green_heart: Message
I hope you find this useful. If you have any questions, please create an issue.