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

hex-rgbs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hex-rgbs

Convert hex to rgba or rgb. The alpha value can be a string.

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

hex-rgbs

Convert hex color codes to rgba or rgb. The alpha value can be a string.

Why the 's'? Well, common npm names were taken. And the unique feature of this module is being able to use a string for the alpha value. Hence having an 's' where the 'a' would normally be in 'rgba'.

Install

# npm || yarn
$ npm install hex-rgbs
$ yarn add hex-rgbs

Usage

const hexRgbs = require('hex-rgbs');

hexRgbs('#ffffff');
hexRgbs('ffffff');
hexRgbs('#fff');
hexRgbs('fff');
// rgb(255, 255, 255)

hexRgbs('#ffffff', 0.5);
hexRgbs('#ffffff', '0.5');
// rgba(255, 255, 255, 0.5)

hexRgbs('#ffffff', 'var(--tw-bg-opacity)');
// rgba(255, 255, 255, var(--tw-bg-opacity))

Keywords

FAQs

Package last updated on 15 Jun 2021

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