---
title: "Get Type-Specific Palettes"
---

### Description

Get all palettes of a specific type.

### Usage

<pre><code class='language-python'>hclpalettes.get_palettes(type_=None, exact=False)</code></pre>

### Arguments

<dl class="pyp-list param-list">
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.palettes.hclpalettes.get_palettes:type_">type_</code><code class="argument-class">None, str</code>
  </dt>
 <dd>(Partial) Name of the palettes which should be returned.
String matching is used; partial matches are allowed.
If set to `None` (default) all palettes will be returned. Names
have to match but are not case sensitive, defaults to None.</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.palettes.hclpalettes.get_palettes:exact">exact</code><code class="argument-class">bool</code>
  </dt>
 <dd>If `False` (default) partial matching is used. If `True`,
`type_` must be an exact match (case sensitive).</dd>
</dl>

### Return

Returns a `list` containing `defaultpalette` objects objects.

### Examples

```{python}
#| echo: true
#| warning: true
#| error: true
# Initialize hclpalettes object
from colorspace import hclpalettes
hclpals = hclpalettes()
# Get all Diverging palettes
pals1 = hclpals.get_palettes("Diverging")
len(pals1)
```

```{python}
#| echo: true
#| warning: true
#| error: true
# Get 'Advanced: Diverging' palettes, also includes
# 'Advanced: DivergingX' (partial match).
pals2 = hclpals.get_palettes("Advanced: Diverging")
len(pals2)
```

```{python}
#| echo: true
#| warning: true
#| error: true
# Only get 'Advanced: Diverging' (exact match)
pals3 = hclpals.get_palettes("Advanced: Diverging", exact = True)
len(pals3)
```

```{python}
#| echo: true
#| warning: true
#| error: true
pals3
```




### Raises

<ul class="python-raises">
<li><code class="text-warning">TypeError</code>: If `type_` is not str or None.
<li><code class="text-warning">TypeError</code>: If `exact` is not bool.
<li><code class="text-warning">ValueError</code>: If no matching palette is found.
</ul>

