QGIS – How to Style a Vector Layer Using Hexadecimal Color Code Stored in Attribute?

fields-attributesqgisqgis-2style

I have a polygon shapefile storing hexadecimal color codes in a specific attribute.

  gid    |   label   |   color
---------+-----------+------------
1        | Crops     | #FF5F2C
2        | Forest    | #00FF00
3        | Pond      | #0000FF
4        | Forest    | #00FF00

I was looking for a way to say QGIS to read these values in order to style the polygons with them. I can't find anything about this.

I hoped it would be possible without deeping into the Python Console (which still frightens me…).

Best Answer

In Layer Properties make a click on "Simple Fill" (in the left part). On the right side click the symbol for data defined color and choose Field type: string > color (field in the attribute table).

enter image description here

It works in QGIS 2.8.2. But I'm missing the different colors for this layer "buffer" in the map legend. enter image description here