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

postcss-color-hex-alpha

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-color-hex-alpha - npm Package Compare versions

Comparing version 5.0.0 to 5.0.1

4

CHANGELOG.md
# Changes to PostCSS Color Hex Alpha
### 5.0.1 (September 18, 2018)
- Fixed: Issue correclty calculating each channel
### 5.0.0 (September 18, 2018)

@@ -4,0 +8,0 @@

13

index.cjs.js

@@ -53,5 +53,7 @@ 'use strict';

}
}; // match a hexa node
}; // decimal precision
const alphaDecimalPrecision = 100000; // match a hexa node
const isAlphaHex = node => node.type === 'word' && alphaHexValueRegExp.test(node.value);

@@ -65,6 +67,7 @@

const r = hex8 >> 32 & 255,
g = hex8 >> 16 & 255,
b = hex8 >> 8 & 255,
a = hex8 & 255; // return a new rgba function, preserving the whitespace of the original node
const _ref = [parseInt(hex8.slice(2, 4), 16), parseInt(hex8.slice(4, 6), 16), parseInt(hex8.slice(6, 8), 16), Math.round(parseInt(hex8.slice(8, 10), 16) / 255 * alphaDecimalPrecision) / alphaDecimalPrecision],
r = _ref[0],
g = _ref[1],
b = _ref[2],
a = _ref[3]; // return a new rgba function, preserving the whitespace of the original node

@@ -71,0 +74,0 @@ const rgbaFunc = valueParser.func({

{
"name": "postcss-color-hex-alpha",
"version": "5.0.0",
"version": "5.0.1",
"description": "Use 4 & 8 character hex color notation in CSS",

@@ -5,0 +5,0 @@ "author": "Jonathan Neal <jonathantneal@hotmail.com>",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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