3

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?

8

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. – mixedbredie Sep 11 '18 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) – Florian Jenn Sep 20 '18 at 7:58
  • 1
    If you want to make the stroke 20% lighter you can use: @darker(@symbol_color, 80) (a little counter intuitive IMHO) – Tiernan Oct 9 '18 at 1:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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