I want to convert color value in this format ((0.19215686274509805, 0.5098039215686274, 0.7411764705882353)) to RGB value.
I tried the following,
import matplotlib
from matplotlib import pyplot as plt
cycler = plt.cycler("color", plt.cm.tab20c.colors)()
color = next(cycler)['color']
color_rgb = matplotlib.colors.to_rgb(color) # <--
The last line, to_rgb(color) doesn't work.
Any suggestions?
The problem you describe is that your statement:
is not true.
As OrOrg already commented:
What you expect is to get the RGB values as integers or a string with a hex-code what can be done as follows:
The matplotlib
.to_hex()works as by you expected :The matplotlib
.to_rgb()drops only the alpha channel from the to it passed color see here