l would like to convert my array of colors to RGB pixel values .
colors
array(['#32CD32', '#CD5C5C', '#00BFFF', '#1E90FF', '#00008B', '#ADFF2F',
'#B0E0E6', '#7CFC00', '#00008B', '#1E90FF', '#F08080', '#F08080',
'#FA8072', '#0000FF', '#7CFC00', '#B0E0E6'],
dtype='<U7')
What l have tried ?
pixel_color = ['#%02x%02x%02x' % (c[0], c[1], c[2]) for c in colors]
l got the following error :
***** TypeError: %x format: an integer is required, not str**
Then l did the following :
pixel_color = ["#%02x%02x%02x" %(int(c[0]), int(c[1]), int(c[2])) for c in colors]
Then l get the following error :
***** ValueError: invalid literal for int() with base 10: '#'**