function RYBToRGB(R, Y, B:byte):TColor;
function cubicInt(t, A, B:single):single;
begin
Result:=A + t*t*(3-2*t)*(B-A);
end;
var iR, iY, iB, x0, x1, x2, x3, y0, y1 : single;
rR, rG, rB : byte;
begin
iR := R/255;
iY := Y/255;
iB := B/255;
x0 := cubicInt(iB, 1.0, 0.163);
x1 := cubicInt(iB, 1.0, 0.0);
x2 := cubicInt(iB, 1.0, 0.5);
x3 := cubicInt(iB, 1.0, 0.2);
y0 := cubicInt(iY, x0, x1);
y1 := cubicInt(iY, x2, x3);
rR := Round(255*cubicInt(iR, y0, y1));
x0 := cubicInt(iB, 1.0, 0.373);
x1 := cubicInt(iB, 1.0, 0.66);
x2 := cubicInt(iB, 0.0, 0.0);
x3 := cubicInt(iB, 0.5, 0.094);
y0 := cubicInt(iY, x0, x1);
y1 := cubicInt(iY, x2, x3);
rG := Round(255*cubicInt(iR, y0, y1));
x0 := cubicInt(iB, 1.0, 0.6);
x1 := cubicInt(iB, 0.0, 0.2);
x2 := cubicInt(iB, 0.0, 0.5);
x3 := cubicInt(iB, 0.0, 0.0);
y0 := cubicInt(iY, x0, x1);
y1 := cubicInt(iY, x2, x3);
rB := Round(255*cubicInt(iR, y0, y1));
Result := (rB shl 16) + (rG shl 8) + rR;
end;