def html5_parse_simple_color(input):
<EOL>if not isinstance(input, unicode) or len(input) != <NUM_LIT:7>:<EOL><INDENT>raise ValueError(<EOL>u"<STR_LIT>"<EOL>u"<STR_LIT>"<EOL>)<EOL><DEDENT>if not input.startswith('<STR_LIT:#>'):<EOL><INDENT>raise ValueError(<EOL>u"<STR_LIT>"<EOL>u"<STR_LIT>"<EOL>)<EOL><DEDENT>if not all(c in string.hexdigits for c in input[<NUM_LIT:1>:]):<EOL><INDENT>raise ValueError(<EOL>u"<STR_LIT>"<EOL>)<EOL><DEDENT>return HTML5SimpleColor(<EOL>int(input[<NUM_LIT:1>:<NUM_LIT:3>], <NUM_LIT:16>),<EOL>int(input[<NUM_LIT:3>:<NUM_LIT:5>], <NUM_LIT:16>),<EOL>int(input[<NUM_LIT:5>:<NUM_LIT:7>], <NUM_LIT:16>)<EOL>)<EOL>
Apply the simple color parsing algorithm from section 2.4.6 of
HTML5.