Install
npm install @ricardo-jrm/color-converter
yarn add @ricardo-jrm/color-converter
Usage
import { hexToRgb, rgbToHex } from '@ricardo-jrm/color-converter'
// Converts a color HEX string to RGB object
hexToRgb('#30a14e');
-> {
r: 48,
g: 161,
b: 78,
}
// Converts given RGB values into a color HEX string
rgbToHex(48, 161, 78);
-> "#30a14e"
License
MIT © Ricardo <l1b3r_-> Mota (@ricardo-jrm)
Bootstrapped with