Changed ui codes a bit to make changing color more flexible.