fix rgba fill and stroke bug

This commit is contained in:
Horcrux
2016-06-10 23:33:18 +08:00
parent dba1fb2801
commit 239e1c928d
4 changed files with 14 additions and 13 deletions
+4 -1
View File
@@ -1,5 +1,8 @@
import _ from 'lodash';
export default function (stops, opacity) {
if (isNaN(opacity)) {
opacity = 1;
}
return _.reduce(stops, (ret, color, key) => {
ret[key] = color.alpha(color.alpha() * opacity).rgbaString();
return ret;