I am using konvajs for drawing on canvas. I just found a opacity property, where I can set the opacity of the whole shape (in my case a closed line) to the alpha value, but that also includes the border and not just the filling opacity.
new Konva.Line({
points: [30, 20, 49, 54, 100, 220],
fill: 'red', // put an opacity just on this color
stroke: 'black',
strokeWidth: 2,
closed : true,
opacity: 0.4
});
Is there a possibility to just make the filling with some opacity and keep the border totally visible?
Just use rgba for fill:
new Konva.Line({
points: [30, 20, 49, 54, 100, 220],
fill: 'rgba(255,0,0,0.4)',
stroke: 'black',
strokeWidth: 2,
closed : true
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With