Skip to content

Commit 4cd8011

Browse files
committed
handle transparent colors in pattern bgcolor
1 parent 35f7e95 commit 4cd8011

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/drawing/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -556,14 +556,19 @@ drawing.pattern = function(sel, calledBy, gd, patternID, shape, size, solidity,
556556
});
557557

558558
if(bgcolor) {
559+
var bgC = tinycolor(bgcolor);
560+
var bgRGB = Color.tinyRGB(bgC);
561+
var bgAlpha = bgC.getAlpha();
562+
559563
var rects = el.selectAll('rect').data([0]);
560564
rects.exit().remove();
561565
rects.enter()
562566
.append('rect')
563567
.attr({
564568
'width': width + 'px',
565569
'height': height + 'px',
566-
'fill': bgcolor
570+
'fill': bgRGB,
571+
'fill-opacity': bgAlpha,
567572
});
568573
}
569574

0 commit comments

Comments
 (0)