Skip to main content
Explanation of code and link addition
Source Link
J. Monticolo
  • 15.9k
  • 1
  • 29
  • 65

In the layer properties, in the symbology tab, define the color by an expression (link to the QGIS doc) :

color_rgb(
    array_get(string_to_array("rgbfargko", ' '), 0),
    array_get(string_to_array("rgbfargko", ' '), 1),
    array_get(string_to_array("rgbfargko", ' '), 2)
)

Explanation of the code :

1- function string_to_array : transform the field data into an array by splitting at the white space character ; 2- function array_get : get elements of the array, the first item has an index of 0 ; 3- function color_rgb : with 3 arguments (R, G, B), this function return a QGIS color.

EDIT The solution of @Ian Turton is more visual and simple !

In the layer properties, in the symbology tab, define the color by an expression :

color_rgb(
    array_get(string_to_array("rgbfargko", ' '), 0),
    array_get(string_to_array("rgbfargko", ' '), 1),
    array_get(string_to_array("rgbfargko", ' '), 2)
)

In the layer properties, in the symbology tab, define the color by an expression (link to the QGIS doc) :

color_rgb(
    array_get(string_to_array("rgbfargko", ' '), 0),
    array_get(string_to_array("rgbfargko", ' '), 1),
    array_get(string_to_array("rgbfargko", ' '), 2)
)

Explanation of the code :

1- function string_to_array : transform the field data into an array by splitting at the white space character ; 2- function array_get : get elements of the array, the first item has an index of 0 ; 3- function color_rgb : with 3 arguments (R, G, B), this function return a QGIS color.

EDIT The solution of @Ian Turton is more visual and simple !

Source Link
J. Monticolo
  • 15.9k
  • 1
  • 29
  • 65

In the layer properties, in the symbology tab, define the color by an expression :

color_rgb(
    array_get(string_to_array("rgbfargko", ' '), 0),
    array_get(string_to_array("rgbfargko", ' '), 1),
    array_get(string_to_array("rgbfargko", ' '), 2)
)