# splitEllipse2.py
from Processing import *

window(500, 500)

def drawEllipse(o, e):
    x, y = mouseX(), mouseY()
    w, h = width(), height()
    if x > 0.5*w:
        fill(255, 0, 0)     # Red on right
    else:
        fill(0, 255, 0)     # Green in left
    ellipse(x, y, 30, 30)

onMousePressed += drawEllipse
