# cPy - demonstrates the usage of drawsvg for a gradient
# Provided by Anthony Vogelaar, Perth Scotland
# rev 0.10  2024-09-16  initial release

# https://pypi.org/project/drawsvg/

import  os;     os.system('clear')
import  drawsvg as  draw

def main():
    d = draw.Drawing(200, 200)
    grad1 = draw.LinearGradient(0, 0, 200, 0)
    grad1.add_stop(0, 'yellow', 1)
    grad1.add_stop(1, 'red', 1)
    ellipse = draw.Ellipse(100, 70, 85, 55, fill=grad1)
    d.append(ellipse)
    d.save_svg('test.svg')
    os.system('./svg_viewer.py test.svg')


main()
