<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rgb_to_hex(color):
 """ Converts from rgb to hex Parameters: color : string Color representation on hex or rgb Example: rgb_to_hex('rgb(23,25,24)') """

    rgb = eval(color.replace('rgb', ''))
    # return '#'+''.join(map(chr, rgb)).encode('hex')
    return '#' + ''.join(['{0:02x}'.format(x).upper() for x in rgb])