---
title: "Algorithmically Lighten Colors"
---

### Description

Takes one or multiple colors and adjust them sucht hat they apper
lightened. See also: [darken](colorspace.utils.darken.qmd).

### Usage

<pre><code class='language-python'>lighten(col, amount=0.1,<br/>        method=&#x27;relative&#x27;,<br/>        space=&#x27;HCL&#x27;, fixup=True)</code></pre>

### Arguments

<dl class="pyp-list param-list">
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.utils.lighten:col">col</code>
  </dt>
 <dd>color (or colors) to be manipulated. Can be a color object
a [palette](colorspace.palettes.palette.qmd) object, or a
str/list of str with valid hex colors.</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.utils.lighten:amount">amount</code><code class="argument-class">float</code>
  </dt>
 <dd>value between `[0., 1.]` with the amount the colors
should be lightened. Defaults to `0.1`.</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.utils.lighten:method">method</code><code class="argument-class">str</code>
  </dt>
 <dd>either `"relative"` (default) or `"absolute"`.</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.utils.lighten:space">space</code><code class="argument-class">str</code>
  </dt>
 <dd>one of `"HCL"` or `"HLS"`. Defaults to `"HCL"`.</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.utils.lighten:fixup">fixup</code><code class="argument-class">bool</code>
  </dt>
 <dd>should colors which fall outside the defined RGB space
be fixed (corrected)? Defaults to `True`.</dd>
</dl>

### Examples

```{python}
#| echo: true
#| warning: true
#| error: true
from colorspace import darken, lighten, swatchplot
original = "#ff3322"
lighter  = lighten(original, amount = 0.3, method = "relative", space = "HCL")
darker   = darken(original,  amount = 0.3, method = "relative", space = "HCL")
swatchplot([lighter, original, darker],
           show_names = False, figsize = (6, 1));
```




### Raises

<ul class="python-raises">
<li><code class="text-warning">TypeError</code>: If `method` is not str.
<li><code class="text-warning">ValueError</code>: If `method` is not one of `&quot;absolute&quot;` or `&quot;relative&quot;`.
<li><code class="text-warning">TypeError</code>: If `space` is not str.
<li><code class="text-warning">ValueError</code>: If `space` is not one of `&quot;HCL&quot;`, `&quot;HLS&quot;`, or `&quot;combined&quot;`.
<li><code class="text-warning">TypeError</code>: If input &#x27;col&#x27; is not among the one of the recognized objects.
<li><code class="text-warning">TypeError</code>: If `fixup` is not bool.
</ul>

