Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

matplotlib convert color string to int

from matplotlib.colors import CSS4_COLORS, to_rgb

# Convert the color 'red' to rgb format:
c = to_rgb(CSS4_COLORS["red"]) # c = (1, 0, 0)

# For all available colors go to: 
# https://matplotlib.org/3.3.1/gallery/color/named_colors.html#sphx-glr-gallery-color-named-colors-py
 
PREVIOUS NEXT
Tagged: #matplotlib #convert #color #string #int
ADD COMMENT
Topic
Name
8+7 =