[Qgis-user] QGIS set the feature label background color the same as the feature style color

Ujaval ujaval at gmail.com
Tue Jul 21 04:08:12 PDT 2015


In the Label -> Background -> Fill Color, you can use the 'Data Defined
override' to enter an expression for the color based on a field

See this for more details
http://gis.stackexchange.com/questions/104706/how-to-create-a-gradient-color-expression-in-data-defined-properties

If you don't want to use the ramps and set individual color values for the
background, you can use an expression like

CASE WHEN  "field" = 1 THEN '0,0,0,255'
 WHEN "field" = 2 THEN '100,100,100,255'
END

-Ujaval

On Tue, Jul 21, 2015 at 10:55 AM, Leahy, Thomas A. <tleahy at bechtel.com>
wrote:

>  Hello,
>
>
>
>           I am trying to set the feature label background color the same
> as the feature style color.
>
>
>
>   I have features colored differently in Style (Categorized based on a
> field) and I would like the label background color to be set the same color
> as the feature style color.
>
>   I have just started working on this and was wondering if someone has
> already done it and can just tell me how it is done.
>
>
>
>            Thanks,
>
>            Tom Leahy
>
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150721/2571d3c4/attachment.html>


More information about the Qgis-user mailing list