human
How do I convert a hex triplet to an RGB tuple and back?
assistant
Here is some code to convert hex triplet string `rgbstr` to rgb tuple

struct.unpack('BBB', rgbstr.decode('hex'))

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.