def _proc_color(self, tokens):
keys = list(tokens.keys())<EOL>if "<STR_LIT>" in keys: <EOL><INDENT>rr, gg, bb = tokens["<STR_LIT>"], tokens["<STR_LIT>"], tokens["<STR_LIT>"]<EOL>hex2int = lambda h: int(h, <NUM_LIT:16>)<EOL>if "<STR_LIT>" in keys:<EOL><INDENT>a = tokens["<STR_LIT>"]<EOL>c = str((hex2int(rr), hex2int(gg), hex2int(bb), hex2int(a)))<EOL><DEDENT>else:<EOL><INDENT>c = str((hex2int(rr), hex2int(gg), hex2int(bb)))<EOL><DEDENT><DEDENT>elif "<STR_LIT>" in keys: <EOL><INDENT>r, g, b = hsv_to_rgb(tokens["<STR_LIT>"],<EOL>tokens["<STR_LIT>"],<EOL>tokens["<STR_LIT:value>"])<EOL>c = str((int(r*<NUM_LIT:255>), int(g*<NUM_LIT:255>), int(b*<NUM_LIT:255>)))<EOL><DEDENT>else:<EOL><INDENT>c = tokens["<STR_LIT>"]<EOL><DEDENT>return c<EOL>
The color traits of a Pen instance must be a string of the form
        (r,g,b) or (r,g,b,a) where r, g, b, and a are integers from 0 to 255,
        a wx.Colour instance, an integer which in hex is of the form 0xRRGGBB,
        where RR is red, GG is green, and BB is blue or a valid color name.