@ricardo-jrm/color-converter
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

🌙 @ricardo-jrm/color-converter

Convert colors: HEX -> RGB / RGB -> HEX

build license

author

lang version size




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 🟪@ricardo-jrm/nova


/@ricardo-jrm/color-converter/

    Package Sidebar

    Install

    npm i @ricardo-jrm/color-converter

    Weekly Downloads

    417

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    12.9 kB

    Total Files

    26

    Last publish

    Collaborators

    • ricardo-jrm