rgb-hex
Convert RGB(A) color to HEX
Last updated 3 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rgb-hex 
SYNC missed versions from official npm registry.

rgb-hex

Convert RGB(A) color to HEX

Install

$ npm install rgb-hex

Usage

import rgbHex from 'rgb-hex';

rgbHex(65, 131, 196);
//=> '4183c4'

rgbHex('rgb(40, 42, 54)');
//=> '282a36'

rgbHex(65, 131, 196, 0.2);
//=> '4183c433'

rgbHex(40, 42, 54, '75%');
//=> '282a36bf'

rgbHex('rgba(40, 42, 54, 75%)');
//=> '282a36bf'

Related

Current Tags

  • 4.1.0                                ...           latest (3 years ago)

7 Versions

  • 4.1.0                                ...           3 years ago
  • 4.0.1                                ...           3 years ago
  • 4.0.0                                ...           5 years ago
  • 3.0.0                                ...           7 years ago
  • 2.1.0                                ...           9 years ago
  • 2.0.0                                ...           10 years ago
  • 1.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 4
Last Day 0
Last Week 3
Last Month 1
Dependencies (0)
None
Dev Dependencies (3)

Copyright 2013 - present © cnpmjs.org | Home |