Check if $color is defined before comparing it