def hex_2_rgb(self, color):
if not self.RE_HEX.match(color):<EOL><INDENT>color = "<STR_LIT>"<EOL><DEDENT>if len(color) == <NUM_LIT:7>:<EOL><INDENT>return (int(color[i : i + <NUM_LIT:2>], <NUM_LIT:16>) / <NUM_LIT:255> for i in [<NUM_LIT:1>, <NUM_LIT:3>, <NUM_LIT:5>])<EOL><DEDENT>return (int(c, <NUM_LIT:16>) / <NUM_LIT:15> for c in color)<EOL>
convert a hex color to rgb