Fix fail on transparent colors in linear gradients

This commit is contained in:
Niklas von Hertzen
2015-03-01 17:43:18 +02:00
parent d9a9615ed7
commit c2baf42145
3 changed files with 3 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ function LinearGradientContainer(imageData) {
}
this.colorStops = imageData.args.slice(hasDirection ? 1 : 0).map(function(colorStop) {
var colorStopMatch = colorStop.match(this.stepRegExp);
var colorStopMatch = colorStop.replace(/transparent/g, 'rgba(0, 0, 0, 0.0)').match(this.stepRegExp);
return {
color: new Color(colorStopMatch[1]),
stop: colorStopMatch[3] === "%" ? colorStopMatch[2] / 100 : null