Added null check before attempting to update the graph panel
Made everything regarding the function's color use the enum
No need to set a color manually