int cmyk2rgb(int c, int m, int y, int k, int z)
Returns the R, G or B value from 0 to 255 depending on the value of z
Lets you convert CMYK color values to RGB color values.
%ffp ctl(0): "Adjust C", Range=(-255,255), val=0 ctl(1): "Adjust M", Range=(-255,255), val=0 ctl(2): "Adjust Y", Range=(-255,255), val=0 ctl(3): "Adjust K", Range=(-255,255), val=0 ForEveryTile:{ int r,g,b,cyan,mag,yel,k; for (y= y_start; y < y_end; y++) { if (updateProgress(y, y_end)) abort(); for (x = x_start; x < x_end; x++) { r = src(x,y,0); g = src(x,y,1); b = src(x,y,2); cyan = rgb2cmyk(r,g,b,0); mag = rgb2cmyk(r,g,b,1); yel = rgb2cmyk(r,g,b,2); k = rgb2cmyk(r,g,b,3); // Do the CMYK adjustment cyan = cyan + ctl(0); mag = mag + ctl(1); yel = yel + ctl(2); k = k + ctl(3); pset( x, y, 0, cmyk2rgb(cyan,mag,yel,k,0) ); pset( x, y, 1, cmyk2rgb(cyan,mag,yel,k,1) ); pset( x, y, 2, cmyk2rgb(cyan,mag,yel,k,2) ); } } return true; }