---
title: "Get Colors"
---

### Description

Returns the colors of the current color palette.

### Usage

<pre><code class='language-python'>heat_hcl.colors(n=11, fixup=None, alpha=None,<br/>                **kwargs)</code></pre>

### Arguments

<dl class="pyp-list param-list">
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.palettes.heat_hcl.colors:n">n</code><code class="argument-class">int</code>
  </dt>
 <dd>Number of colors which should be returned.</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.palettes.heat_hcl.colors:fixup">fixup</code><code class="argument-class">None, bool</code>
  </dt>
 <dd>Should sRGB colors be corrected if they lie
outside the defined color space?  If `None` the `fixup`
parameter from the object will be used. Can be set to `True` or
`False` to explicitly control the fixup here.</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.palettes.heat_hcl.colors:alpha">alpha</code><code class="argument-class">None, float, list, or numpy.ndarray</code>
  </dt>
 <dd>Allows to add an transparency
(alpha channel) to the colors. Can be a single float, a list, or a
numpy array. If a list or array is provided it must be of length 1 or
of length `n` and be convertible to float, providing values
between `0.0` (full opacity) and `1.0` (full transparency)</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.palettes.heat_hcl.colors:**kwargs">**kwargs</code>
  </dt>
 <dd>Currently allows for `rev = True` to reverse the colors.</dd>
</dl>

### Return

<code>list</code>: Returns a list of str with `n` colors from the
color palette.

### Examples

```{python}
#| echo: true
#| warning: true
#| error: true
from colorspace import sequential_hcl, hexcols
sequential_hcl().colors()
```

```{python}
#| echo: true
#| warning: true
#| error: true
# Different sequential palette
cols = sequential_hcl("Rocket").colors(5)
cols
```

```{python}
#| echo: true
#| warning: true
#| error: true
hexcols(cols)
```

```{python}
#| echo: true
#| warning: true
#| error: true
# Five colors with constant alpha of 0.3
sequential_hcl().colors(5, alpha = 0.3)
```

```{python}
#| echo: true
#| warning: true
#| error: true
# Three colors with variying alpha
sequential_hcl().colors(3, alpha = [0.2, 0.8, 0.3])
```



