Completed the updateColor function and added the call to the event handler