Change Double to PDouble.
L := changed to l: =
Myfunction(a, b, c: integer; l:p Double):Double;
begin
l^:=(0. 16 * a+0.58 * b+0.27 * c)/255; ;
End;