def rgba_to_hex(rgba_string):
 return ('#' + ''.join([hex(int(each)).replace('0x', '').upper() for each in rgba_string.replace('rgba(', '').replace(')', '').split(',')[:(-1)]]))

def rgba_to_hex ( rgba_string ) : return ( '#' + '' . join ( [ hex ( int ( each ) ) . replace ( '0x' , '' ) . upper ( ) for each in rgba_string . replace ( 'rgba(' , '' ) . replace ( ')' , '' ) . split ( ',' ) [ : ( - 1 ) ] ] ) )
returns an uppercase hex representation of an rgba string .