stylecow-plugin-msfilter-background-alpha
Advanced tools
Comparing version 4.0.1 to 4.0.2
11
index.js
@@ -1,2 +0,2 @@ | ||
var color = require('stylecow-color'); | ||
var Color = require('color'); | ||
@@ -20,9 +20,10 @@ module.exports = function (stylecow) { | ||
if (fn) { | ||
var rgba = color.toRGBA(fn); | ||
var color = Color(fn.toString()); | ||
var hex = color.hexString(); | ||
if (rgba[3] === 1) { | ||
return fn.replaceWith(stylecow.parse('#' + color.RGBA_HEX(rgba), 'Hex')); | ||
if (color.alpha() == 1) { | ||
return fn.replaceWith(stylecow.parse(hex, 'Hex')); | ||
} | ||
var hex = '#' + Math.round(255 * rgba[3]).toString(16) + color.RGBA_HEX(rgba); | ||
hex = hex.replace('#', '#' + Math.round(255 * color.alpha()).toString(16)); | ||
@@ -29,0 +30,0 @@ stylecow.utils.addMsFilter(declaration.getParent('Block'), 'progid:DXImageTransform.Microsoft.gradient(startColorStr="' + hex + '", endColorStr="' + hex + '")'); |
{ | ||
"name": "stylecow-plugin-msfilter-background-alpha", | ||
"description": "Stylecow plugin to add ms filters emulating the rgba/hsla colors in backgrounds in explorer < 9 using ms filters.", | ||
"version": "4.0.1", | ||
"author": "Oscar Otero <oom@oscarotero.com>", | ||
"homepage": "https://github.com/stylecow/stylecow-plugin-msfilter-background-alpha", | ||
"bugs": "https://github.com/stylecow/stylecow-plugin-msfilter-background-alpha/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/stylecow/stylecow-plugin-msfilter-background-alpha.git" | ||
}, | ||
"main": "index.js", | ||
"dependencies": { | ||
"stylecow-color": "2.*" | ||
}, | ||
"devDependencies": { | ||
"stylecow": "6.*" | ||
}, | ||
"scripts": { | ||
"test": "mocha tests/cases.js" | ||
}, | ||
"license": "MIT" | ||
"name": "stylecow-plugin-msfilter-background-alpha", | ||
"description": "Stylecow plugin to add ms filters emulating the rgba/hsla colors in backgrounds in explorer < 9 using ms filters.", | ||
"version": "4.0.2", | ||
"author": "Oscar Otero <oom@oscarotero.com>", | ||
"homepage": "https://github.com/stylecow/stylecow-plugin-msfilter-background-alpha", | ||
"bugs": "https://github.com/stylecow/stylecow-plugin-msfilter-background-alpha/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/stylecow/stylecow-plugin-msfilter-background-alpha.git" | ||
}, | ||
"main": "index.js", | ||
"dependencies": { | ||
"color": "^0.8.0" | ||
}, | ||
"devDependencies": { | ||
"stylecow": "6.*" | ||
}, | ||
"scripts": { | ||
"test": "mocha tests/cases.js" | ||
}, | ||
"license": "MIT" | ||
} |
@@ -225,4 +225,10 @@ { | ||
{ | ||
"class": "Number", | ||
"name": 50 | ||
"class": "Unit", | ||
"name": "%", | ||
"children": [ | ||
{ | ||
"class": "Number", | ||
"name": 50 | ||
} | ||
] | ||
} | ||
@@ -235,4 +241,10 @@ ] | ||
{ | ||
"class": "Number", | ||
"name": 50 | ||
"class": "Unit", | ||
"name": "%", | ||
"children": [ | ||
{ | ||
"class": "Number", | ||
"name": 50 | ||
} | ||
] | ||
} | ||
@@ -239,0 +251,0 @@ ] |
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
13156
409
+ Addedcolor@^0.8.0
+ Addedcolor@0.8.0(transitive)
+ Addedcolor-convert@0.5.3(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcolor-string@0.3.0(transitive)
- Removedstylecow-color@2.*