Gradient.sel
#!./Selene
Selene.UseDirectFB("--dfb:quiet,no-vt")
DirectFB.init( DirectFB.CooperativeConst('FULLSCREEN') );
srf = SelSurface.create { caps=SelSurface.CapabilityConst('PRIMARY') } w,h = srf:GetSize()
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'
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'
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'
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'
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'
srf:Release()