I am having the same problem with geological maps in QGIS 2.10. The maps supplied have a have a CMYK colorcode (Actually "YMCK" )that can be interpreted with the following formula:
color_cmyk(
CASE WHEN substr("COLOR_CODE",3,1 ) IS 0 THEN 0
WHEN substr("COLOR_CODE",3,1 ) IS 1 THEN 7
WHEN substr("COLOR_CODE",3,1 ) IS 2 THEN 14
WHEN substr("COLOR_CODE",3,1 ) IS 3 THEN 21
WHEN substr("COLOR_CODE",3,1 ) IS 4 THEN 31
WHEN substr("COLOR_CODE",3,1 ) IS 5 THEN 42
WHEN substr("COLOR_CODE",3,1 ) IS 6 THEN 54
WHEN substr("COLOR_CODE",3,1 ) IS 7 THEN 67
WHEN substr("COLOR_CODE",3,1 ) IS 8 THEN 80
ELSE 100
END,
CASE WHEN substr("COLOR_CODE",2,1 ) IS 0 THEN 0
WHEN substr("COLOR_CODE",2,1 ) IS 1 THEN 7
WHEN substr("COLOR_CODE",2,1 ) IS 2 THEN 14
WHEN substr("COLOR_CODE",2,1 ) IS 3 THEN 21
WHEN substr("COLOR_CODE",2,1 ) IS 4 THEN 31
WHEN substr("COLOR_CODE",2,1 ) IS 5 THEN 42
WHEN substr("COLOR_CODE",2,1 ) IS 6 THEN 54
WHEN substr("COLOR_CODE",2,1 ) IS 7 THEN 67
WHEN substr("COLOR_CODE",2,1 ) IS 8 THEN 80
ELSE 100
END,
CASE WHEN substr("COLOR_CODE",1,1 ) IS 0 THEN 0
WHEN substr("COLOR_CODE",1,1 ) IS 1 THEN 7
WHEN substr("COLOR_CODE",1,1 ) IS 2 THEN 14
WHEN substr("COLOR_CODE",1,1 ) IS 3 THEN 21
WHEN substr("COLOR_CODE",1,1 ) IS 4 THEN 31
WHEN substr("COLOR_CODE",1,1 ) IS 5 THEN 42
WHEN substr("COLOR_CODE",1,1 ) IS 6 THEN 54
WHEN substr("COLOR_CODE",1,1 ) IS 7 THEN 67
WHEN substr("COLOR_CODE",1,1 ) IS 8 THEN 80
ELSE 100
END,
CASE WHEN substr("COLOR_CODE",4,1 ) IS 0 THEN 0
WHEN substr("COLOR_CODE",4,1 ) IS 1 THEN 7
WHEN substr("COLOR_CODE",4,1 ) IS 2 THEN 14
WHEN substr("COLOR_CODE",4,1 ) IS 3 THEN 21
WHEN substr("COLOR_CODE",4,1 ) IS 4 THEN 31
WHEN substr("COLOR_CODE",4,1 ) IS 5 THEN 42
WHEN substr("COLOR_CODE",4,1 ) IS 6 THEN 54
WHEN substr("COLOR_CODE",4,1 ) IS 7 THEN 67
WHEN substr("COLOR_CODE",4,1 ) IS 8 THEN 80
ELSE 0
END)
but this gives the black color in the legend boxes.
So I thought I could solve the problem by using the above script to compute a new color field which worked quite well and returned the RGB values such as 255,200,220.
Then I tried
Color_rgb("Color")
to produce a data defined color without any luck (invalid formula) !
So I parsed the color field into 3 fields - Red, Green and Blue and the following formula -
color_rgb("Red","Green","Blue")
in the data defined color formula box gave the right color on the map and the legend is no longer black - but uses the color ramp settings to determine the legend color.
It seems we need an option on the color ramp drop down box to specify data defined colors and then it should use whatever the data defined color is to produce the legend.
All other work-arounds are fine but when using the legend filter on the map composer one wants to get the right result and not have to go to every legend box and type in the rgb codes in the choose color options.