I have created a shapefile with lines which I use to place labels exactly where I want them relative to map features. The shapefile has a field for the name that will appear as the label and also a field called Terrain Type.
I am trying to get the label colour to set based upon the value in the Terrain Type field.
(I am new to QGIS, not using real world data and haven't programmed since using OpenScript with Toolbook about 20 years ago)
Here is what I was trying to do... Based on another help response I found online, I right clicked on the drop down for the colour in the labels section of the Text section and wrote the following code:
CASE WHEN "Terrain Type" = "Coniferous Forest" THEN Color_rgb (18,95,27) WHEN "Terrain Type" = "Hill" THEN Color_rgb (231,238,239) WHEN "Terrain Type" = "Coastal Plain" THEN Color_rgb (35,209,16) WHEN "Terrain Type" = "Bay" THEN Color_rgb (101,78,240) WHEN "Terrain Type" = "Scrub" THEN Color_rgb (155,222,61) END
It returns an error message saying "Eval Error: Column 'Coniferous Forest' not found".
I have checked the set of similar questions and they don't seem to get me where I need to go.