## LUA Pixel(x, y) Function

Help! I am trying to make a FADE function that fades from one picture to another.

for fde=1, 255 do
for they=1, 272 do
for thex=1, 480 do
imgpixel=oldimageixel(thex, they)
imgprgb=imgpixel:colors()
oimgpixel=newimageixel(thex, they)
oimgprgb=oimgpixel:colors ()

if imgprgb.r > oimgprgb.r then imgprgb.r=imgprgb.r-1 end
if imgprgb.r < oimgprgb.r then imgprgb.r=imgprgb.r+1 end
if imgprgb.g > oimgprgb.g then imgprgb.g=imgprgb.g-1 end
if imgprgb.g < oimgprgb.g then imgprgb.g=imgprgb.g+1 end
if imgprgb.b > oimgprgb.b then imgprgb.b=imgprgb.b-1 end
if imgprgb.b < oimgprgb.b then imgprgb.b=imgprgb.b+1 end

newpixcolor=Color.new(img prgb.r, imgprgb.g, imgprgb.b)
oldimageixel(thex, they, newpixcolor)
end
end
screen.flip()

end
end
Apparently, there are 2 pixel functions, one that is just a function that sets pixels, with 3 arguments, and one that just gets the color of a pixel, with two arguments.

NOW. When I call this function, it says "An argument was incorrect". I AM using the right number of arguments, and doing everything right (I think). Any help here Please?

Thanks,
Josh