import amanith, pygame, sys, time
 
# Create the display
pygame.display.init()
pygame.display.set_mode((640, 480), pygame.OPENGL | pygame.DOUBLEBUF)
 
# Create a drawboard for drawing vector graphics
drawboard = amanith.GOpenGLBoard(0, 0, 640, 480)
 
# Create a linear gradient
keys = [
  amanith.GKeyValue(0.0, (1.0, 0.0, 0.0, 1.0)),
  amanith.GKeyValue(0.5, (1.0, 1.0, 1.0, 1.0)),
  amanith.GKeyValue(1.0, (1.0, 0.0, 0.0, 1.0)),
]
       
grad = drawboard.CreateLinearGradient((360, 100), (320, 300), keys)
       
# Draw the shape
drawboard.SetFillEnabled(True)
drawboard.SetStrokeEnabled(True)
drawboard.SetStrokeWidth(8)
drawboard.SetStrokeGradient(grad)
drawboard.SetStrokePaintType(amanith.G_GRADIENT_PAINT_TYPE)

drawboard.Clear(1.0, 1.0, 1.0, True)
drawboard.SetFillPaintType(amanith.G_GRADIENT_PAINT_TYPE)
drawboard.SetFillGradient(grad)
drawboard.DrawPaths("M 320,360 c +250,+100 +250,-175 0,-300 c -250,+100 -250,+400 0,300 z")
       
# Show it for a few seconds
pygame.display.flip()
time.sleep(10)

