Gradient.sel

#!./Selene
Selene.UseDirectFB("--dfb:quiet,no-vt")
DirectFB.init( DirectFB.CooperativeConst('FULLSCREEN') );	-- Set display cooperative mode

srf = SelSurface.create { caps=SelSurface.CapabilityConst('PRIMARY') } -- create a primary surface
w,h = srf:GetSize()	-- Retrieve its size

srf:Clear(0,0,0,0)

print "4 corners"
print( srf:FillGrandient { TopLeft={255,255,255,255}, TopRight={255,0,0,255}, BottomLeft={0,255,0,255}, BottomRight={0,0,255,255} } )

print "Hit 'enter' key to exit"
io.stdin:read'*l'	-- wait for enter

print "2 horizontal corners"
print( srf:FillGrandient { TopLeft={255,0,0,255}, TopRight={0,255,0,255} } )

print "Hit 'enter' key to exit"
io.stdin:read'*l'	-- wait for enter

print "Full horizontal"
print( srf:FillGrandient { TopLeft={255,0,0,255}, BottomLeft={255,0,0,255}, TopRight={0,255,0,255}, BottomRight={0,255,0,255} } )

print "Hit 'enter' key to exit"
io.stdin:read'*l'	-- wait for enter


print "Full top and 1 corner at the bottom"
print( srf:FillGrandient { TopLeft={255,0,0,255}, TopRight={255,0,0,255}, BottomLeft={0,255,0,255} } )

print "Hit 'enter' key to exit"
io.stdin:read'*l'	-- wait for enter

print "Diagonal"
print( srf:FillGrandient { TopLeft={255,0,0,255}, BottomRight={0,255,0,255} } )

print "Hit 'enter' key to exit"
io.stdin:read'*l'	-- wait for enter

srf:Release()
generated by LDoc 1.4.6 Last updated 2022-09-05 22:24:51