Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var myalpha = function(color, value) {
if (color.string && color.string.indexOf('$') === 0) {
return color;
}
else {
color = color.rgba;
if (value) {
return stylus.functions.rgba(
new stylus.nodes.Unit(color.r),
new stylus.nodes.Unit(color.g),
new stylus.nodes.Unit(color.b),
value
);
}
return new stylus.nodes.Unit(color.a, '');
}
};
var myalpha = function(color, alpha) {
if (color.string.indexOf('$') === 0) {
return color;
}
else {
color = color.rgba;
if (value) {
return stylus.functions.rgba(
new stylus.nodes.Unit(color.r),
new stylus.nodes.Unit(color.g),
new stylus.nodes.Unit(color.b),
value
);
}
return new stylus.nodes.Unit(color.a, '');
}
};