Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rgb-hex

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rgb-hex

Convert RGB(A) color to HEX

  • 4.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
50K
decreased by-80.17%
Maintainers
1
Weekly downloads
 
Created

What is rgb-hex?

The rgb-hex npm package is a simple utility that converts RGB color values to hexadecimal color codes. It is useful for web developers and designers who need to work with color values in different formats.

What are rgb-hex's main functionalities?

Convert RGB to Hex

This feature allows you to convert RGB color values to a hexadecimal string. In this example, the RGB value (255, 0, 0) is converted to the hex value 'ff0000'.

const rgbHex = require('rgb-hex');
const hexColor = rgbHex(255, 0, 0); // 'ff0000'
console.log(hexColor);

Convert RGBA to Hex

This feature allows you to convert RGBA color values to a hexadecimal string, including the alpha channel. In this example, the RGBA value (255, 0, 0, 0.5) is converted to the hex value 'ff000080'.

const rgbHex = require('rgb-hex');
const hexColor = rgbHex(255, 0, 0, 0.5); // 'ff000080'
console.log(hexColor);

Other packages similar to rgb-hex

Keywords

FAQs

Package last updated on 01 Sep 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc