I'm trying to declare a function that returns TFPColor type but I got an error message:
Error: Identifier not found "TFPColor"
function luminosity(img: TImage; i,j: Integer): TFPColor;
var
r, g, b: byte;
begin
r:= round(red(img.Picture.bitmap.canvas.pixels[i,j]) * 0.21);
g:= round(green(img.Picture.bitmap.canvas.pixels[i,j]) * 0.72);
b:= round(blue(img.Picture.bitmap.canvas.pixels[i,j]) * 0.07);
luminosity := TColorToFPColor(RGBToColor(r, g, b));
end;
I've already declared the Graphics unit in the preamble of the unit!