#python中颜色对应的RGB数字
- 样式一
from matplotlib import colors
orange_rgb = colors.hex2color(colors.cnames['yellow'])
print(orange_rgb)
2. 样式二
from matplotlib import colors
print(colors.to_rgba('yellow'))
3 . 样式三
from PIL import ImageColor
print(ImageColor.getcolor('yellow','RGBA'))
4.样式4
from PIL import ImageColor
print(ImageColor.getcolor('yellow','RGB'))