Color.name#
- property Color.name: str | None[source]#
Get the color name.
The name is always formatted as a lower case string with underscore delimiters between words.
See Named Colors for a list of supported colors.
Changed in version 0.48: Multi-word names are now delimited with
_e.g.'alice_blue'instead of'aliceblue'.
Examples#
Download Python source code | Download Jupyter notebook
Create a dark blue color with half opacity.
When creating a new Color, the name may be delimited with a space,
hyphen, underscore, or written as a single word.
Upper-case letters are also supported.
However, the name is always standardized as lower-case with an underscore between words.
>>> c
Color(name='dark_blue', hex='#00008b80', opacity=128)