I would like to fill up an attribute table in QGIS for the feature 'Color' based on another feature in the attribute table.
At the moment it looks like this for the features 'Direction' and 'Color':
north none south none east none west none
I would like to fill the Color feature with RGB color codes to directly plot them by using my code. At the moment I only managed to add a new Field for the feature Color (the other features are already implemented). For example if there is North, the color code '0,165,0,255' shall be inserted into the other feature.
# b is the shapefile applied from PyQt4.QtCore import * b.dataProvider().addAttributes([ QgsField("Farben", QVariant.String) ]) b.updateFields()