def check_color(option, opt, value):
try:<EOL><INDENT>return parse_color(value)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise optparse.OptionValueError("<STR_LIT>"<EOL>% (opt, value))<EOL><DEDENT>
Validate and convert an option value of type 'color'.

    ``option`` is an optparse.Option instance.

    ``opt`` is a string with the user-supplied option name (e.g. '--bgcolor').

    ``value`` is the user-supplied value.