Code: Select all
-- grayscales.lua by Geo Massar, 2005
dofile "LPut01.lua"
green = Color.new(0, 255, 0)
bg = Image.createEmpty(480,272) -- background
bg:caption(152,28, "Gray Scales", green, 2)
bg:print(2,262, "by Geo Massar, 2005 (aka KawaGeo)", green)
bg:fillRect(111,71, 258,130, green)
for i = 0, 3 do
mark = 111 + 64*i
bg:drawLine(mark,200, mark,207, green)
end
bg:drawLine(368,200, 368,207, green) -- last mark
bg:print(109,210, "0", green)
bg:print(169,210, "64", green)
bg:print(229,210, "128", green)
bg:print(293,210, "192", green)
bg:print(358,210, "255", green)
for x = 0, 255 do
gray = Color.new(x,x,x)
bg:drawLine(112+x,72, 112+x,199, gray)
end
bg:save "grayscales.tga"
screen:blit(0,0, bg)
screen.flip()
while true do
screen.waitVblankStart()
end
Screenshot:

NOTE: With the current version of LP, the display shows only 32 scales. There will be full 256 scales in the future version. Right, Shine?