Since you mention you're a rookie, here is a detailed step-by-step guide :
Open the Layer Styling panel to set a data-defined color

- Right click on the layer in the layer tree, and click Properties... to open the above panel
- Click on Symbology (1) to open the layer styling tab
- Click on Simple Fil (2) to configure symbol
- Click on the button on the right of the fill color field (3)
- Click on Edit to open the expression builder
Define a conversion function
Here are the CMYK to RGB conversion formula
r = 255 * (1-c) * (1-k)
g = 255 * (1-m) * (1-k)
b = 255 * (1-y) * (1-k)
The QGIS expression builder already includes a bunch of color-related functions, but unfortunately for you, none which convert a cmyk string to a rgb string. But you can easily add your own functions.

- Click on the Function Editor tab (1)
- Replace the content of the function panel (2) with the following code:
from qgis.core import *
from qgis.gui import *
@qgsfunction(args='auto', group='Color')
def cmyk_to_rgb(cmyk_string, feature, parent):
""" Convert a cmyk color string to a rgb color string """
c,m,y,k = [int(val)/100 for val in cmyk_string.split(',')]
r = str(int(255 * (1-c) * (1-k)))
g = str(int(255 * (1-m) * (1-k)))
b = str(int(255 * (1-y) * (1-k)))
return ",".join((r,g,b))
- Click on the "Save and Load Functions" button
- You can now use the newly-defined cmyk_to_rgb in the expression builder
Use the Expression Builder

- Almost done now. Go back to the Expression tab (1)
- Type
cmyk_to_rgb( "cmykFargekode")
in the Expression Field (2)
- Press Ok (3)
This should do the trick.
Edit
QGIS provides a function color_cmyk
that takes 4 integers (or string representation of integers) as input. As J. Monticolo pointed out, you can actually use the default QGIS functions to build an expression that performs the task. The whole "Define a conversion function" step can thus be avoided.
eval('color_cmyk(' || "cmykFargekode" || ')')
Explanation:
"cmykFargekode"
is expanded to say '47,0,80,0'
- It is then concatenated (
||
syntax) with 'color_cmyk('
and ')'
which gives the string 'color_cmyk(47,0,80,0)'
- This string is evaluated with the
eval
function and tadaa!
The other suggested approach relies on the with_variable
syntax
with_variable('cmyk', string_to_array("cmykFargekode"),
color_cmyk(@cmyk[0], @cmyk[1], @cmyk[2], @cmyk[3])
)
Explanation:
"cmykFargekode"
is expanded to say '47,0,80,0'
string_to_array
converts the string to an array ['47', '0', '80', '0']
with_variable
stores this array in a variable called 'cmyk'
, which is then accessible in the second part of the expression as `@cmyk'
- The second part of the expression
color_cmyk(@cmyk[0], @cmyk[1], @cmyk[2], @cmyk[3])
is evaluated
data defined override
(of symbol colours).