https://github.com/mcnaveen/node-hex-to-rgb
Simple utility to convert HEX color codes to RGB Values
https://github.com/mcnaveen/node-hex-to-rgb
color convert convertor hex node-module nodejs nodejs-modules rgb
Last synced: about 1 month ago
JSON representation
Simple utility to convert HEX color codes to RGB Values
- Host: GitHub
- URL: https://github.com/mcnaveen/node-hex-to-rgb
- Owner: mcnaveen
- Created: 2022-03-02T12:56:06.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-02T12:57:01.000Z (over 4 years ago)
- Last Synced: 2025-09-30T03:21:12.524Z (8 months ago)
- Topics: color, convert, convertor, hex, node-module, nodejs, nodejs-modules, rgb
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/node-hex-to-rgb
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Convert HEX to RGB
:unicorn: Simple utility to convert HEX color codes to RGB Values


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