Comparing version 4.1.0 to 4.2.0
15
index.js
@@ -245,2 +245,17 @@ const colorString = require('color-string'); | ||
hexa(value) { | ||
if (arguments.length > 0) { | ||
return new Color(value); | ||
} | ||
const rgbArray = this.rgb().round().color; | ||
let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase(); | ||
if (alphaHex.length === 1) { | ||
alphaHex = '0' + alphaHex; | ||
} | ||
return colorString.to.hex(rgbArray) + alphaHex; | ||
}, | ||
rgbNumber() { | ||
@@ -247,0 +262,0 @@ const rgb = this.rgb().color; |
{ | ||
"name": "color", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"description": "Color conversion and manipulation with CSS string support", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
16688
392