---
title: "Create HSV Color Object"
---

### Description

Creates a color object in the Hue-Saturation-Value (HSV) color space.
Can be converted to: [RGB](colorspace.colorlib.RGB.qmd), [sRGB](colorspace.colorlib.sRGB.qmd), [HLS](colorspace.colorlib.HLS.qmd),
and [hexcols](colorspace.colorlib.hexcols.qmd).
Not allowed (ambiguous) are transformations to [CIEXYZ](colorspace.colorlib.CIEXYZ.qmd),
[CIELUV](colorspace.colorlib.CIELUV.qmd), [CIELAB](colorspace.colorlib.CIELAB.qmd), [polarLUV](colorspace.colorlib.polarLUV.qmd), and
[polarLAB](colorspace.colorlib.polarLAB.qmd).

### Usage

<pre><code class='language-python'>HSV(H, S, V, alpha=None)</code></pre>

### Arguments

<dl class="pyp-list param-list">
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.colorlib.HSV:H">H</code><code class="argument-class">int, float, list, numpy.array</code>
  </dt>
 <dd>Numeric value(s) for Hue dimension.</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.colorlib.HSV:S">S</code><code class="argument-class">int, float, list, numpy.array</code>
  </dt>
 <dd>Numeric value(s) for Saturation dimension.</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.colorlib.HSV:V">V</code><code class="argument-class">int, float, list, numpy.array</code>
  </dt>
 <dd>Numeric value(s) for Value dimension.</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.colorlib.HSV:alpha">alpha</code><code class="argument-class">None, float, list, numpy.array</code>
  </dt>
 <dd>Numeric value(s) for the alpha
channel (`[0., 1.]`) where `0.` equals full transparency, `1.` full
opacity. If `None` (default) no transparency is added.</dd>
</dl>

### Methods

<dl class="pyp-list method-list">
    <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
       <code>[HSV.colors(fixup=True, rev=False)](colorspace.colorlib.HSV.colors.qmd)</code>
    </dt>
    <dd>Extract Hex Colors</dd>
    <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
       <code>[HSV.dropalpha()](colorspace.colorlib.HSV.dropalpha.qmd)</code>
    </dt>
    <dd>Remove Alpha Channel</dd>
    <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
       <code>[HSV.get(dimname=None)](colorspace.colorlib.HSV.get.qmd)</code>
    </dt>
    <dd>Extracting Color Coordinates</dd>
    <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
       <code>[HSV.get_whitepoint()](colorspace.colorlib.HSV.get_whitepoint.qmd)</code>
    </dt>
    <dd>Get White Point</dd>
    <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
       <code>[HSV.hasalpha()](colorspace.colorlib.HSV.hasalpha.qmd)</code>
    </dt>
    <dd>Check for Alpha Channel</dd>
    <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
       <code>[HSV.hclplot(**kwargs)](colorspace.colorlib.HSV.hclplot.qmd)</code>
    </dt>
    <dd>Palette Plot in HCL Space</dd>
    <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
       <code>[HSV.length()](colorspace.colorlib.HSV.length.qmd)</code>
    </dt>
    <dd>Get Number of Colors</dd>
    <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
       <code>[HSV.set(**kwargs)](colorspace.colorlib.HSV.set.qmd)</code>
    </dt>
    <dd>Set Coordinates/Manipulate Colors</dd>
    <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
       <code>[HSV.set_whitepoint(**kwargs)](colorspace.colorlib.HSV.set_whitepoint.qmd)</code>
    </dt>
    <dd>Set White Point</dd>
    <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
       <code>[HSV.specplot(**kwargs)](colorspace.colorlib.HSV.specplot.qmd)</code>
    </dt>
    <dd>Color Spectrum Plot</dd>
    <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
       <code>[HSV.swatchplot(**kwargs)](colorspace.colorlib.HSV.swatchplot.qmd)</code>
    </dt>
    <dd>Palette Swatch Plot</dd>
    <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
       <code>[HSV.to(to, fixup=True)](colorspace.colorlib.HSV.to.qmd)</code>
    </dt>
    <dd>Transform Color Space</dd>
</dl>


### Examples

```{python}
#| echo: true
#| warning: true
#| error: true
# Constructing object via numpy arrays
from colorspace import HSV
# Constructing color object with one single color via float
HSV(150, 150, 10)
```

```{python}
#| echo: true
#| warning: true
#| error: true
# Constructing object via lists
HSV([150, 150, 10], [1.5, 0, 1.5], [0.1, 0.7, 0.1])
```

```{python}
#| echo: true
#| warning: true
#| error: true
# Constructing object via numpy arrays
from numpy import asarray
cols = HSV(asarray([150, 150, 150]),
           asarray([1.5, 0, 1.5]),
           asarray([0.1, 0.7, 0.1]))
cols
```

```{python}
#| echo: true
#| warning: true
#| error: true
# Converting to RGB
cols.to("RGB")
cols
```



