JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4077
  • Score
    100M100P100Q141388F
  • License MIT

Lightweight module for adding opacity to hexadecimal colors

Package Exports

  • hex-color-opacity

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hex-color-opacity) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hex-color-opacity

GitHub Workflow Status (branch) Code Climate coverage npm js-standard-style

Lightweight module for adding opacity to hexadecimal colors

Install

npm i hex-color-opacity

Usage

const opacity = require('hex-color-opacity')

opacity('#ffffff', 0.5)

Documentation

Adding Opacity To Hexadecimal Color Values

To add opacity to a hex color simply pass the color value (this includes the # character) and the desired opacity as a number value between 0 and 1 to the opacity function. The resulting hex value is returned. Support for 3 value hex colors is provided.

For example:

opacity('#fff', 0.5) // #ffffff80