---
title: "Convert Standard RGB (sRGB) to Hex Colors"
---

### Description

Converting one (or multiple) colors defined by their red, green, and
blue coordinates from the Standard RGB color space to hex colors.

### Usage

<pre><code class='language-python'>colorlib.sRGB_to_hex(r, g, b, 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.colorlib.colorlib.sRGB_to_hex:r">r</code><code class="argument-class">numpy.ndarray</code>
  </dt>
 <dd>Intensities for red (`[0., 1.,]`).</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.colorlib.colorlib.sRGB_to_hex:g">g</code><code class="argument-class">numpy.ndarray</code>
  </dt>
 <dd>Intensities for green (`[0., 1.,]`).</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.colorlib.colorlib.sRGB_to_hex:b">b</code><code class="argument-class">numpy.ndarray</code>
  </dt>
 <dd>Intensities for blue (`[0., 1.,]`).</dd>
  <dt style = "white-space: nowrap; font-family: monospace; vertical-align: top">
   <code id="colorspace.colorlib.colorlib.sRGB_to_hex:fixup">fixup</code><code class="argument-class">bool</code>
  </dt>
 <dd>Whether or not the `rgb` values should be corrected
if they lie outside the defined RGB space (outside `[0., 1.,]`),
defaults to `True`.</dd>
</dl>

### Return

<code>list</code>: A list with hex color str.
