postcss-color-hex-alpha
Advanced tools
Comparing version 5.0.0 to 5.0.1
# 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 @@ |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
24664
176
0