Socket
Socket
Sign inDemoInstall

rgb-hex-conv

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rgb-hex-conv

Convert RGB color codes to hexadecimal 6 digits or 3 digits format for use in web design and CSS.


Version published
Weekly downloads
5
increased by66.67%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

rgb-hex-conv

Convert RGB values of a color to a hexadecimal notation 6-digit or 3-digit string

Usage

const rgbHexConv = require('rgb-hex-conv');

// 6 digits hexadecimal notation
rgbHexConv(2,3,4);
// returns '020304'
rgbHexConv(255,0,255);
// returns 'FF00FF'
rgbHexConv(200,123,49);
// returns 'C87B31'
rgbHexConv(123,97,1);
// returns '7B6101'

// 3 digits hexadecimal notation
rgbHexConv(2,3,4, true);
// returns '000'
rgbHexConv(255,0,255, true);
// returns 'F0F'
rgbHexConv(200,123,49, true);
// returns 'C73'
rgbHexConv(123,97,1, true);
// returns '760'

License

MIT © Damian Polak

Keywords

FAQs

Last updated on 24 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc