used new Event class
calcGradient