---
title: "Rename Custom Palette"
---

### Description

Allows to set, remplace, or remove the name of a palette.

### Usage

<pre><code class='language-python'>palette.rename(name)</code></pre>

### Arguments

<dl class="pyp-list param-list">
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.palettes.palette.rename:name">name</code><code class="argument-class">None, str</code>
  </dt>
 <dd>new name for the palette.</dd>
</dl>

### Examples

```{python}
#| echo: true
#| warning: true
#| error: true
from colorspace import palette
```

```{python}
#| echo: true
#| warning: true
#| error: true
# Starting from an unnamed palette
pal = palette(["#11C638", "#E2E2E2", "#EF9708"])
pal.name() # Returns None
```

```{python}
#| echo: true
#| warning: true
#| error: true
# Naming the palette
pal.rename("Custom palette")
pal.name()
```

```{python}
#| echo: true
#| warning: true
#| error: true
# Rename
pal.rename("Modified palette name")
pal.name()
```

```{python}
#| echo: true
#| warning: true
#| error: true
# Unname (replace current name with None)
pal.rename(None)
pal.name() # Returns None
```




### Raises

<ul class="python-raises">
<li><code class="text-warning">ValueError</code>: If input &#x27;name&#x27; is not of type str.
</ul>

