proper CGColor type checking