Just realised, there is another option. Define a gradient which transitions from transparent to the desired colour and back to transparent. You could duplicate and edit the "FG to transparent" gradient to achieve this. Then, before painting your strokes, select the "use colour from gradient" option, pick the new gradient, and set the stroke length.