I was trying to use alpha channel to apply transparency on line colors with CustomPaint
's Canvas.drawLine()
.
Problem
However, the color tweaks on alpha channel takes no effect on the results, for example, the following code still gives me 100% opaque white lines
final gridPaint = Paint()
..strokeJoin = StrokeJoin.miter
..strokeWidth = 1.0
..color = const Color(0xe6ffffff)
..style = PaintingStyle.stroke;
canvas.drawLine(start, end, gridPaint);
Workaround
I have to draw 1-pixel-wide drawRect
to get transparent lines.
Question
Is this by design?