from colorspace import palette
Rename Custom Palette
Description
Allows to set, remplace, or remove the name of a palette.
Usage
palette.rename(name)
Arguments
-
name
None, str
- new name for the palette.
Examples
# Starting from an unnamed palette
= palette(["#11C638", "#E2E2E2", "#EF9708"])
pal # Returns None pal.name()
# Naming the palette
"Custom palette")
pal.rename( pal.name()
'Custom palette'
# Rename
"Modified palette name")
pal.rename( pal.name()
'Modified palette name'
# Unname (replace current name with None)
None)
pal.rename(# Returns None pal.name()
Raises
-
ValueError
: If input 'name' is not of type str.