This question already has an answer here:

How do I dynamically color labels in the color of the labeled feature? As you can see in the screenshot, the lines are in different colors, but the labels are just in black. As I know, I have to set the label color manually to get my expected result. But is there also a dynamic way to do so? Surely there is, because it‘s QGIS! But I don‘t know how. Any Ideas?

enter image description here

marked as duplicate by underdark Mar 10 at 21:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You need to use the following expression at the label color:


enter image description here

enter image description here

Here is the output:

enter image description here

  • 1
    QGIS rocks again and again! – MAP Mar 10 at 18:25

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