Feature request #12693
option to have the label color automatically match the polygon color
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Easy fix?:||No||Copied to github as #:||20799|
Sorry if this is already available, I couldn't find anything for it. I have projects that come up from time to time that include either a large volume of shapefiles, or a shapefile that we have to edit the style to categorized and classify into a large number of sets (one last week had over 1400 of them in one project). When we do this we end up with a log of polygons, each set having it's own color as it should.
When we go to work with it on the map, sometimes it can get a bit crowded with all the different Labels. Since all the labels are the same color, it can be hard to tell which areas are for which sets (we rely heavily on knowing the label names in these cases).
Can an option be added that would make the label colors automatically match the polygon colors? This would be very helpful!
Please let me know if anyone has any questions on what's being requested.
#2 Updated by Harrissou Santanna over 8 years ago
Wouldn't it be hard to read red label on red polygon, yellow label inside yellow polygon and so on...?
Do you know that you can set how labels must show using the "data defined override" properties? You "just" have to add appropriate fields to your shapefile. But I think the plugin EasyCustomLabelling may help in that way. You should give it a look.
#3 Updated by Cris Jesse over 8 years ago
Adding in shadows, backgrounds, buffers, etc would take care of not being able to see the matching colors.
I did install the EasyCustomLabelling plugin, but I'm not seeing it anywhere (or any different options). I'm on QGIS 2.8.1.
Not sure I understand how to pull the color of the polygon into the "data defined override" properties. Where would I get the color data for each polygon from to enter here? I can understand if I only have a couple how to do it one by one, but when I've got 1400 colors to match up...?
#5 Updated by Harrissou Santanna over 8 years ago
Did u set your color manually? all 1400? wouaw...
I don't think There is currently a graphic way to automatically match labels color with the one defined manually in the style properties, unless python or xml skills...
What I was thinking about, with data defined feature, is to fill a field in your shape with a rgb value for each (category of?) polygon. And then select this field through "data defined override" tool to set style or label color value. And later, all you'll have to do if you want to update color is to change the value in the field. But I don't know how will legend look like...
EasyCustomLabeling plugin creates a new label file containing values from polygon file and adds to it new fields to design color (color, font, size, alignment, visibility...). The value set in those fields will be applied to the label automatically, this is why I proposed it.
Maybe, if needed, this discussion should continue in the user mailing list to not flood your pertinent feature request with support matters.
#6 Updated by Cris Jesse over 8 years ago
lol, thankfully no I did not set all those colors manually. I simply went to:
> Style (tab)
Categorized (from top dropdown menu)
Chose the column to sort by (from 2nd drop down menu)
I will google more on how to use the EasyCustomLabelling plugin to see if I can find a workaround there, but so far I have had no luck pulling those colors from any files to insert into the Labeling section so that the polygon and label colors match up.
#8 Updated by Cris Jesse over 8 years ago
- File color-pick_qgis.png added
I honestly don't know enough to know where to draw the line between where plugin vs direct functionality lies. I've attached a screenshot of where I see this being put in (as an option just below the cursor in the dropdown color box). In my non-developer (and still somewhat novice) opinion this would be best inserted directly where it would be used, right in the color dropdown box.
The functionality would probably be helpful for any of the color options in the label section (text, buffer, background, shadow).