Skip to content

grvty-labs/Hex2RgbColor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hex2rgbcolor

License: MIT Projects connected

Javascript plugin that allows conversions between RGB and Hexadecimal.

Install

npm install hex2rgbcolor

Usage

import { hexToRgb, arrayHexToRgb, arrayRgbToHex } from 'hex2rgbcolor';

const a = ['#f00', '#abc001', '#ba0'];

hexToRgb('#F00') // { r: 255, g: 0, b: 0 }

arrayHexToRgb(a); // [{"b": 0, "g": 0, "r": 255}, {"b": 1, "g": 192, "r": 171}, {"b": 0, "g": 170, "r": 187}]

const b = [
  {"b": 0, "g": 0, "r": 255},
  {"b": 1, "g": 192, "r": 171},
  {"b": 0, "g": 170, "r": 187}
];

arrayRgbToHex(b); // ['#ff0000', '#abc001', '#bbaa00']

yiq_is_light('#000000'); // false

yiq_is_light('#ffffff'); // true


Test

jest

Made for you, with ❤️ from

StackShare GRVTY

About

Javascript plugin that allows conversions between RGB and Hexadecimal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published