This seems somewhat basic, but is there a way to set the colors for both fill and stroke of a polygon layer at the same time? I find myself frequently having to change the colors in multiple places, especially when I am using line fill types. Changing the highest level color changes the fills in subordinate layers, but doesn't affect the stroke.

This dialogue allows you to change fill colors in all subordinate styles enter image description here

but doesn't affect the strokes enter image description here

Am I missing a setting somewhere?

1 Answer 1


If you set the stroke colour using the expression editor ("E" box on right of dropdown):

enter image description here

Then you can use @symbol_color for the stroke colour:

enter image description here

which ignores the colour in the drop-down, and doesn't render it in the preview top right of the dialog, but does (when applied) give you strokes that match the fill. Even if you change the fill colour. Here's what I get, with large dotted strokes so you can see them:

enter image description here

  • 2
    In addition to the @symbol_color function you can use @darker(@symbol_color, 150) and @lighter(@symbol_color, 80) in the Stroke Colour expression to make the border 50% darker or 20% lighter respectively. Adjust the numbers as required. Sep 11, 2018 at 19:49
  • 1
    Sadly, this doesn’t seem to work with marker symbols. The expression editor shows preview value which looks right, but the markers’ stroke is still drawn with the colour from the drop-down. (Qgis 3.2.0) Sep 20, 2018 at 7:58
  • 2
    If you want to make the stroke 20% lighter you can use: @darker(@symbol_color, 80) (a little counter intuitive IMHO)
    – Tiernan
    Oct 9, 2018 at 1:55
  • Can this be used in combination with alpha so that the strokes transparency matches the polygons fill transparency?
    – anakaine
    Apr 8, 2021 at 1:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.