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...).


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

| improve this answer | |
  • There is no connection between coors and attributes, so ... no legend possible. See also hub.qgis.org/issues/11491. – Hanne K Jul 22 '15 at 14:22
  • Good! Many thanks... It works perfectly. The legend issue has to be kept in mind, depending on the necessity to produce a map or not. – wiltomap Jul 22 '15 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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