Can I change the colour of different segments of a path? For example; this code result in everything being drawn in green but I would have thought (incorrectly it seems) that the rectangle would be red and the line green?
juce::Path p;
g.setColour(juce::Colours::red);
p.addRectangle(getLocalBounds().reduced(2));
g.strokePath(p, juce::PathStrokeType(3));
g.setColour(juce::Colours::green);
p.startNewSubPath(100, 100);
p.lineTo(200, 200);
g.strokePath(p, juce::PathStrokeType(3));
p.closeSubPath();

If I can’t achieve what I want above with a single path, I can use two paths:

But it seems I can’t have one path appear on top of another?
juce::Path p;
g.setColour(juce::Colours::red);
p.addRectangle(getLocalBounds().reduced(2));
g.strokePath(p, juce::PathStrokeType(3));
g.setColour(juce::Colours::green);
juce::Path p2;
p2.startNewSubPath(0, 0);
p2.lineTo(0, 200);
g.strokePath(p2, juce::PathStrokeType(3));
p2.closeSubPath();
In this case I would expect a green line to appear over the top left part of the red border, but it doesn’t.

So obviously I have some misunderstandings about how paths are supposed to work. Any care to enlighten me? 