Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="container">
  <div class="hue-control">
    <div class="hue-control-row">
      <label for="hue-slider">
        Hue: <span class="hue-value" id="hue-value"></span>
      </label>
      <input class="hue-slider" id="hue-slider" type="range" min="0" max="360" />
      <input type="checkbox" class="mono-toggle" id="mono-toggle" aria-label="Toggle monochrome colors"></input>
    </div>

    <div class="hue-control-row">
      <p id="tolerance-text" class="tolerance-text">hue tolerance: <span id="tolerance-value">5</span>
    </div>
  </div>

  <div class="chart-container" id="chart-container">
    <div id="chart" class="chart"></div>
    <div id="color-info" class="color-info" inert="true"></div>
    <div class="axis lightness-axis">
      lightness
    </div>
    <div class="axis saturation-axis" id="saturation-axis">
      saturation
    </div>
  </div>
</div>

<a href="https://github.com/scriptype/sorted-colors" target="_blank" class="github-link">
  <svg class="github-icon" role="img" alt="Check this on Github">
    <use xlink:href="#github-icon"></use>
  </svg>
</a>

<svg style="display: none" height="16" width="16" xmlns="http://www.w3.org/2000/svg">
  <symbol id="back-icon" viewBox="0 0 16 16">
    <path d="M16 7H3.8l5.6-5.6L8 0 0 8l8 8 1.4-1.4L3.8 9H16V7z" fill="currentColor" fill-rule="evenodd"/>
  </symbol>

  <symbol id="github-icon" viewBox="0 0 1024 1024">
  <path d="M512 0C229.25 0 0 229.25 0 512c0 226.25 146.688 418.125 350.156 485.812 25.594 4.688 34.938-11.125 34.938-24.625 0-12.188-.469-52.562-.719-95.312C242 908.812 211.906 817.5 211.906 817.5c-23.312-59.125-56.844-74.875-56.844-74.875-46.531-31.75 3.53-31.125 3.53-31.125 51.406 3.562 78.47 52.75 78.47 52.75 45.688 78.25 119.875 55.625 149 42.5 4.654-33 17.904-55.625 32.5-68.375-113.656-12.937-233.218-56.875-233.218-253.063 0-55.938 19.969-101.562 52.656-137.406-5.219-13-22.844-65.094 5.062-135.562 0 0 42.938-13.75 140.812 52.5 40.812-11.406 84.594-17.031 128.125-17.219 43.5.188 87.312 5.875 128.188 17.281 97.688-66.312 140.688-52.5 140.688-52.5 28 70.531 10.375 122.562 5.125 135.5 32.812 35.844 52.625 81.469 52.625 137.406 0 196.688-119.75 240-233.812 252.688 18.438 15.875 34.75 47 34.75 94.75 0 68.438-.688 123.625-.688 140.5 0 13.625 9.312 29.562 35.25 24.562C877.438 930 1024 738.125 1024 512 1024 229.25 794.75 0 512 0z"/>
</svg>

<table id="colorsTable">
  <thead>
    <tr>
      <th id="name">Name</th>
      <th id="rgb">RGB</th>
      <th id="hsl">HSL</th>
      <th id="hex">Hex</th>
      <th id="alternativeName">Alternative Name</th>
    </tr>
  </thead>

  <tbody>
    <tr class="light">
      <td>aliceblue</td>
      <td>rgb(240,248,255)</td>
      <td>hsl(208,100%,97.1%)</td>
      <td>#F0F8FF</td>
    </tr>

    <tr class="light">
      <td>antiquewhite</td>
      <td>rgb(250,235,215)</td>
      <td>hsl(34,77.8%,91.2%)</td>
      <td>#FAEBD7</td>
    </tr>

    <tr class="light">
      <td>aqua</td>
      <td>rgb(0,255,255)</td>
      <td>hsl(180,100%,50%)</td>
      <td>#00FFFF</td>
    </tr>

    <tr class="light">
      <td>aquamarine</td>
      <td>rgb(127,255,212)</td>
      <td>hsl(160,100%,74.9%)</td>
      <td>#7FFFD4</td>
    </tr>

    <tr class="light">
      <td>azure</td>
      <td>rgb(240,255,255)</td>
      <td>hsl(180,100%,97.1%)</td>
      <td>#F0FFFF</td>
    </tr>

    <tr class="light">
      <td>beige</td>
      <td>rgb(245,245,220)</td>
      <td>hsl(60,55.6%,91.2%)</td>
      <td>#F5F5DC</td>
    </tr>

    <tr class="light">
      <td>bisque</td>
      <td>rgb(255,228,196)</td>
      <td>hsl(33,100%,88.4%)</td>
      <td>#FFE4C4</td>
    </tr>

    <tr class="dark">
      <td>black</td>
      <td>rgb(0,0,0)</td>
      <td>hsl(0,0%,0%)</td>
      <td>#000000</td>
    </tr>

    <tr class="light">
      <td>blanchedalmond</td>
      <td>rgb(255,235,205)</td>
      <td>hsl(36,100%,90.2%)</td>
      <td>#FFEBCD</td>
    </tr>

    <tr class="dark">
      <td>blue</td>
      <td>rgb(0,0,255)</td>
      <td>hsl(240,100%,50%)</td>
      <td>#0000FF</td>
    </tr>

    <tr class="dark">
      <td>blueviolet</td>
      <td>rgb(138,43,226)</td>
      <td>hsl(271,75.9%,52.7%)</td>
      <td>#8A2BE2</td>
    </tr>

    <tr class="dark">
      <td>brown</td>
      <td>rgb(165,42,42)</td>
      <td>hsl(0,59.4%,40.6%)</td>
      <td>#A52A2A</td>
    </tr>

    <tr class="light">
      <td>burlywood</td>
      <td>rgb(222,184,135)</td>
      <td>hsl(34,56.9%,70%)</td>
      <td>#DEB887</td>
    </tr>

    <tr class="light">
      <td>cadetblue</td>
      <td>rgb(95,158,160)</td>
      <td>hsl(182,25.5%,50%)</td>
      <td>#5F9EA0</td>
    </tr>

    <tr class="light">
      <td>chartreuse</td>
      <td>rgb(127,255,0)</td>
      <td>hsl(90,100%,50%)</td>
      <td>#7FFF00</td>
    </tr>

    <tr class="light">
      <td>chocolate</td>
      <td>rgb(210,105,30)</td>
      <td>hsl(25,75%,47.1%)</td>
      <td>#D2691E</td>
    </tr>

    <tr class="light">
      <td>coral</td>
      <td>rgb(255,127,80)</td>
      <td>hsl(16,100%,65.7%)</td>
      <td>#FF7F50</td>
    </tr>

    <tr class="light">
      <td>cornflowerblue</td>
      <td>rgb(100,149,237)</td>
      <td>hsl(219,79.2%,66.1%)</td>
      <td>#6495ED</td>
    </tr>

    <tr class="light">
      <td>cornsilk</td>
      <td>rgb(255,248,220)</td>
      <td>hsl(48,100%,93.1%)</td>
      <td>#FFF8DC</td>
    </tr>

    <tr class="dark">
      <td>crimson</td>
      <td>rgb(220,20,60)</td>
      <td>hsl(348,83.3%,47.1%)</td>
      <td>#DC143C</td>
    </tr>

    <tr class="light">
      <td>cyan</td>
      <td>rgb(0,255,255)</td>
      <td>hsl(180,100%,50%)</td>
      <td>#00FFFF</td>
      <td>aqua</td>
    </tr>

    <tr class="dark">
      <td>darkblue</td>
      <td>rgb(0,0,139)</td>
      <td>hsl(240,100%,27.3%)</td>
      <td>#00008B</td>
    </tr>

    <tr class="dark">
      <td>darkcyan</td>
      <td>rgb(0,139,139)</td>
      <td>hsl(180,100%,27.3%)</td>
      <td>#008B8B</td>
    </tr>

    <tr class="light">
      <td>darkgoldenrod</td>
      <td>rgb(184,134,11)</td>
      <td>hsl(43,88.7%,38.2%)</td>
      <td>#B8860B</td>
    </tr>

    <tr class="light">
      <td>darkgray</td>
      <td>rgb(169,169,169)</td>
      <td>hsl(0,0%,66.3%)</td>
      <td>#A9A9A9</td>
      <td>darkgrey</td>
    </tr>

    <tr class="dark">
      <td>darkgreen</td>
      <td>rgb(0,100,0)</td>
      <td>hsl(120,100%,19.6%)</td>
      <td>#006400</td>
    </tr>

    <tr class="light">
      <td>darkgrey</td>
      <td>rgb(169,169,169)</td>
      <td>hsl(0,0%,66.3%)</td>
      <td>#A9A9A9</td>
    </tr>

    <tr class="light">
      <td>darkkhaki</td>
      <td>rgb(189,183,107)</td>
      <td>hsl(56,38.3%,58%)</td>
      <td>#BDB76B</td>
    </tr>

    <tr class="dark">
      <td>darkmagenta</td>
      <td>rgb(139,0,139)</td>
      <td>hsl(300,100%,27.3%)</td>
      <td>#8B008B</td>
    </tr>

    <tr class="dark">
      <td>darkolivegreen</td>
      <td>rgb(85,107,47)</td>
      <td>hsl(82,39%,30.2%)</td>
      <td>#556B2F</td>
    </tr>

    <tr class="light">
      <td>darkorange</td>
      <td>rgb(255,140,0)</td>
      <td>hsl(33,100%,50%)</td>
      <td>#FF8C00</td>
    </tr>

    <tr class="dark">
      <td>darkorchid</td>
      <td>rgb(153,50,204)</td>
      <td>hsl(280,60.6%,49.8%)</td>
      <td>#9932CC</td>
    </tr>

    <tr class="dark">
      <td>darkred</td>
      <td>rgb(139,0,0)</td>
      <td>hsl(0,100%,27.3%)</td>
      <td>#8B0000</td>
    </tr>

    <tr class="light">
      <td>darksalmon</td>
      <td>rgb(233,150,122)</td>
      <td>hsl(15,71.6%,69.6%)</td>
      <td>#E9967A</td>
    </tr>

    <tr class="light">
      <td>darkseagreen</td>
      <td>rgb(143,188,143)</td>
      <td>hsl(120,25.1%,64.9%)</td>
      <td>#8FBC8F</td>
    </tr>

    <tr class="dark">
      <td>darkslateblue</td>
      <td>rgb(72,61,139)</td>
      <td>hsl(248,39%,39.2%)</td>
      <td>#483D8B</td>
    </tr>

    <tr class="dark">
      <td>darkslategray</td>
      <td>rgb(47,79,79)</td>
      <td>hsl(180,25.4%,24.7%)</td>
      <td>#2F4F4F</td>
      <td>darkslategrey</td>
    </tr>

    <tr class="dark">
      <td>darkslategrey</td>
      <td>rgb(47,79,79)</td>
      <td>hsl(180,25.4%,24.7%)</td>
      <td>#2F4F4F</td>
    </tr>

    <tr class="light">
      <td>darkturquoise</td>
      <td>rgb(0,206,209)</td>
      <td>hsl(181,100%,41%)</td>
      <td>#00CED1</td>
    </tr>

    <tr class="dark">
      <td>darkviolet</td>
      <td>rgb(148,0,211)</td>
      <td>hsl(282,100%,41.4%)</td>
      <td>#9400D3</td>
    </tr>

    <tr class="dark">
      <td>deeppink</td>
      <td>rgb(255,20,147)</td>
      <td>hsl(328,100%,53.9%)</td>
      <td>#FF1493</td>
    </tr>

    <tr class="light">
      <td>deepskyblue</td>
      <td>rgb(0,191,255)</td>
      <td>hsl(195,100%,50%)</td>
      <td>#00BFFF</td>
    </tr>

    <tr class="dark">
      <td>dimgray</td>
      <td>rgb(105,105,105)</td>
      <td>hsl(0,0%,41.2%)</td>
      <td>#696969</td>
      <td>dimgrey</td>
    </tr>

    <tr class="dark">
      <td>dimgrey</td>
      <td>rgb(105,105,105)</td>
      <td>hsl(0,0%,41.2%)</td>
      <td>#696969</td>
    </tr>

    <tr class="dark">
      <td>dodgerblue</td>
      <td>rgb(30,144,255)</td>
      <td>hsl(210,100%,55.9%)</td>
      <td>#1E90FF</td>
    </tr>

    <tr class="dark">
      <td>firebrick</td>
      <td>rgb(178,34,34)</td>
      <td>hsl(0,67.9%,41.6%)</td>
      <td>#B22222</td>
    </tr>

    <tr class="light">
      <td>floralwhite</td>
      <td>rgb(255,250,240)</td>
      <td>hsl(40,100%,97.1%)</td>
      <td>#FFFAF0</td>
    </tr>

    <tr class="dark">
      <td>forestgreen</td>
      <td>rgb(34,139,34)</td>
      <td>hsl(120,60.7%,33.9%)</td>
      <td>#228B22</td>
    </tr>

    <tr class="light">
      <td>fuchsia</td>
      <td>rgb(255,0,255)</td>
      <td>hsl(300,100%,50%)</td>
      <td>#FF00FF</td>
    </tr>

    <tr class="light">
      <td>gainsboro</td>
      <td>rgb(220,220,220)</td>
      <td>hsl(0,0%,86.3%)</td>
      <td>#DCDCDC</td>
    </tr>

    <tr class="light">
      <td>ghostwhite</td>
      <td>rgb(248,248,255)</td>
      <td>hsl(240,100%,98.6%)</td>
      <td>#F8F8FF</td>
    </tr>

    <tr class="light">
      <td>gold</td>
      <td>rgb(255,215,0)</td>
      <td>hsl(51,100%,50%)</td>
      <td>#FFD700</td>
    </tr>

    <tr class="light">
      <td>goldenrod</td>
      <td>rgb(218,165,32)</td>
      <td>hsl(43,74.4%,49%)</td>
      <td>#DAA520</td>
    </tr>

    <tr class="light">
      <td>gray</td>
      <td>rgb(128,128,128)</td>
      <td>hsl(0,0%,50.2%)</td>
      <td>#808080</td>
      <td>grey</td>
    </tr>

    <tr class="dark">
      <td>green</td>
      <td>rgb(0,128,0)</td>
      <td>hsl(120,100%,25.1%)</td>
      <td>#008000</td>
    </tr>

    <tr class="light">
      <td>greenyellow</td>
      <td>rgb(173,255,47)</td>
      <td>hsl(84,100%,59.2%)</td>
      <td>#ADFF2F</td>
    </tr>

    <tr class="light">
      <td>grey</td>
      <td>rgb(128,128,128)</td>
      <td>hsl(0,0%,50.2%)</td>
      <td>#808080</td>
    </tr>

    <tr class="light">
      <td>honeydew</td>
      <td>rgb(240,255,240)</td>
      <td>hsl(120,100%,97.1%)</td>
      <td>#F0FFF0</td>
    </tr>

    <tr class="light">
      <td>hotpink</td>
      <td>rgb(255,105,180)</td>
      <td>hsl(330,100%,70.6%)</td>
      <td>#FF69B4</td>
    </tr>

    <tr class="light">
      <td>indianred</td>
      <td>rgb(205,92,92)</td>
      <td>hsl(0,53.1%,58.2%)</td>
      <td>#CD5C5C</td>
    </tr>

    <tr class="dark">
      <td>indigo</td>
      <td>rgb(75,0,130)</td>
      <td>hsl(275,100%,25.5%)</td>
      <td>#4B0082</td>
    </tr>

    <tr class="light">
      <td>ivory</td>
      <td>rgb(255,255,240)</td>
      <td>hsl(60,100%,97.1%)</td>
      <td>#FFFFF0</td>
    </tr>

    <tr class="light">
      <td>khaki</td>
      <td>rgb(240,230,140)</td>
      <td>hsl(54,76.9%,74.5%)</td>
      <td>#F0E68C</td>
    </tr>

    <tr class="light">
      <td>lavender</td>
      <td>rgb(230,230,250)</td>
      <td>hsl(240,66.7%,94.1%)</td>
      <td>#E6E6FA</td>
    </tr>

    <tr class="light">
      <td>lavenderblush</td>
      <td>rgb(255,240,245)</td>
      <td>hsl(340,100%,97.1%)</td>
      <td>#FFF0F5</td>
    </tr>

    <tr class="light">
      <td>lawngreen</td>
      <td>rgb(124,252,0)</td>
      <td>hsl(90,100%,49.4%)</td>
      <td>#7CFC00</td>
    </tr>

    <tr class="light">
      <td>lemonchiffon</td>
      <td>rgb(255,250,205)</td>
      <td>hsl(54,100%,90.2%)</td>
      <td>#FFFACD</td>
    </tr>

    <tr class="light">
      <td>lightblue</td>
      <td>rgb(173,216,230)</td>
      <td>hsl(195,53.3%,79%)</td>
      <td>#ADD8E6</td>
    </tr>

    <tr class="light">
      <td>lightcoral</td>
      <td>rgb(240,128,128)</td>
      <td>hsl(0,78.9%,72.2%)</td>
      <td>#F08080</td>
    </tr>

    <tr class="light">
      <td>lightcyan</td>
      <td>rgb(224,255,255)</td>
      <td>hsl(180,100%,93.9%)</td>
      <td>#E0FFFF</td>
    </tr>

    <tr class="light">
      <td>lightgoldenrodyellow</td>
      <td>rgb(250,250,210)</td>
      <td>hsl(60,80%,90.2%)</td>
      <td>#FAFAD2</td>
    </tr>

    <tr class="light">
      <td>lightgray</td>
      <td>rgb(211,211,211)</td>
      <td>hsl(0,0%,82.7%)</td>
      <td>#D3D3D3</td>
      <td>lightgrey</td>
    </tr>

    <tr class="light">
      <td>lightgreen</td>
      <td>rgb(144,238,144)</td>
      <td>hsl(120,73.4%,74.9%)</td>
      <td>#90EE90</td>
    </tr>

    <tr class="light">
      <td>lightgrey</td>
      <td>rgb(211,211,211)</td>
      <td>hsl(0,0%,82.7%)</td>
      <td>#D3D3D3</td>
    </tr>

    <tr class="light">
      <td>lightpink</td>
      <td>rgb(255,182,193)</td>
      <td>hsl(351,100%,85.7%)</td>
      <td>#FFB6C1</td>
    </tr>

    <tr class="light">
      <td>lightsalmon</td>
      <td>rgb(255,160,122)</td>
      <td>hsl(17,100%,73.9%)</td>
      <td>#FFA07A</td>
    </tr>

    <tr class="dark">
      <td>lightseagreen</td>
      <td>rgb(32,178,170)</td>
      <td>hsl(177,69.5%,41.2%)</td>
      <td>#20B2AA</td>
    </tr>

    <tr class="light">
      <td>lightskyblue</td>
      <td>rgb(135,206,250)</td>
      <td>hsl(203,92%,75.5%)</td>
      <td>#87CEFA</td>
    </tr>

    <tr class="light">
      <td>lightslategray</td>
      <td>rgb(119,136,153)</td>
      <td>hsl(210,14.3%,53.3%)</td>
      <td>#778899</td>
      <td>lightslategrey</td>
    </tr>

    <tr class="light">
      <td>lightslategrey</td>
      <td>rgb(119,136,153)</td>
      <td>hsl(210,14.3%,53.3%)</td>
      <td>#778899</td>
    </tr>

    <tr class="light">
      <td>lightsteelblue</td>
      <td>rgb(176,196,222)</td>
      <td>hsl(214,41.1%,78%)</td>
      <td>#B0C4DE</td>
    </tr>

    <tr class="light">
      <td>lightyellow</td>
      <td>rgb(255,255,224)</td>
      <td>hsl(60,100%,93.9%)</td>
      <td>#FFFFE0</td>
    </tr>

    <tr class="light">
      <td>lime</td>
      <td>rgb(0,255,0)</td>
      <td>hsl(120,100%,50%)</td>
      <td>#00FF00</td>
    </tr>

    <tr class="light">
      <td>limegreen</td>
      <td>rgb(50,205,50)</td>
      <td>hsl(120,60.8%,50%)</td>
      <td>#32CD32</td>
    </tr>

    <tr class="light">
      <td>linen</td>
      <td>rgb(250,240,230)</td>
      <td>hsl(30,66.7%,94.1%)</td>
      <td>#FAF0E6</td>
    </tr>

    <tr class="light">
      <td>magenta</td>
      <td>rgb(255,0,255)</td>
      <td>hsl(300,100%,50%)</td>
      <td>#FF00FF</td>
      <td>fuchsia</td>
    </tr>

    <tr class="dark">
      <td>maroon</td>
      <td>rgb(128,0,0)</td>
      <td>hsl(0,100%,25.1%)</td>
      <td>#800000</td>
    </tr>

    <tr class="light">
      <td>mediumaquamarine</td>
      <td>rgb(102,205,170)</td>
      <td>hsl(160,50.7%,60.2%)</td>
      <td>#66CDAA</td>
    </tr>

    <tr class="dark">
      <td>mediumblue</td>
      <td>rgb(0,0,205)</td>
      <td>hsl(240,100%,40.2%)</td>
      <td>#0000CD</td>
    </tr>

    <tr class="light">
      <td>mediumorchid</td>
      <td>rgb(186,85,211)</td>
      <td>hsl(288,58.9%,58%)</td>
      <td>#BA55D3</td>
    </tr>

    <tr class="light">
      <td>mediumpurple</td>
      <td>rgb(147,112,219)</td>
      <td>hsl(260,59.8%,64.9%)</td>
      <td>#9370DB</td>
    </tr>

    <tr class="light">
      <td>mediumseagreen</td>
      <td>rgb(60,179,113)</td>
      <td>hsl(147,49.8%,46.9%)</td>
      <td>#3CB371</td>
    </tr>

    <tr class="light">
      <td>mediumslateblue</td>
      <td>rgb(123,104,238)</td>
      <td>hsl(249,79.8%,67.1%)</td>
      <td>#7B68EE</td>
    </tr>

    <tr class="light">
      <td>mediumspringgreen</td>
      <td>rgb(0,250,154)</td>
      <td>hsl(157,100%,49%)</td>
      <td>#00FA9A</td>
    </tr>

    <tr class="light">
      <td>mediumturquoise</td>
      <td>rgb(72,209,204)</td>
      <td>hsl(178,59.8%,55.1%)</td>
      <td>#48D1CC</td>
    </tr>

    <tr class="dark">
      <td>mediumvioletred</td>
      <td>rgb(199,21,133)</td>
      <td>hsl(322,80.9%,43.1%)</td>
      <td>#C71585</td>
    </tr>

    <tr class="dark">
      <td>midnightblue</td>
      <td>rgb(25,25,112)</td>
      <td>hsl(240,63.5%,26.9%)</td>
      <td>#191970</td>
    </tr>

    <tr class="light">
      <td>mintcream</td>
      <td>rgb(245,255,250)</td>
      <td>hsl(150,100%,98%)</td>
      <td>#F5FFFA</td>
    </tr>

    <tr class="light">
      <td>mistyrose</td>
      <td>rgb(255,228,225)</td>
      <td>hsl(6,100%,94.1%)</td>
      <td>#FFE4E1</td>
    </tr>

    <tr class="light">
      <td>moccasin</td>
      <td>rgb(255,228,181)</td>
      <td>hsl(38,100%,85.5%)</td>
      <td>#FFE4B5</td>
    </tr>

    <tr class="light">
      <td>navajowhite</td>
      <td>rgb(255,222,173)</td>
      <td>hsl(36,100%,83.9%)</td>
      <td>#FFDEAD</td>
    </tr>

    <tr class="dark">
      <td>navy</td>
      <td>rgb(0,0,128)</td>
      <td>hsl(240,100%,25.1%)</td>
      <td>#000080</td>
    </tr>

    <tr class="light">
      <td>oldlace</td>
      <td>rgb(253,245,230)</td>
      <td>hsl(39,85.2%,94.7%)</td>
      <td>#FDF5E6</td>
    </tr>

    <tr class="dark">
      <td>olive</td>
      <td>rgb(128,128,0)</td>
      <td>hsl(60,100%,25.1%)</td>
      <td>#808000</td>
    </tr>

    <tr class="dark">
      <td>olivedrab</td>
      <td>rgb(107,142,35)</td>
      <td>hsl(80,60.5%,34.7%)</td>
      <td>#6B8E23</td>
    </tr>

    <tr class="light">
      <td>orange</td>
      <td>rgb(255,165,0)</td>
      <td>hsl(39,100%,50%)</td>
      <td>#FFA500</td>
    </tr>

    <tr class="light">
      <td>orangered</td>
      <td>rgb(255,69,0)</td>
      <td>hsl(16,100%,50%)</td>
      <td>#FF4500</td>
    </tr>

    <tr class="light">
      <td>orchid</td>
      <td>rgb(218,112,214)</td>
      <td>hsl(302,58.9%,64.7%)</td>
      <td>#DA70D6</td>
    </tr>

    <tr class="light">
      <td>palegoldenrod</td>
      <td>rgb(238,232,170)</td>
      <td>hsl(55,66.7%,80%)</td>
      <td>#EEE8AA</td>
    </tr>

    <tr class="light">
      <td>palegreen</td>
      <td>rgb(152,251,152)</td>
      <td>hsl(120,92.5%,79%)</td>
      <td>#98FB98</td>
    </tr>

    <tr class="light">
      <td>paleturquoise</td>
      <td>rgb(175,238,238)</td>
      <td>hsl(180,64.9%,81%)</td>
      <td>#AFEEEE</td>
    </tr>

    <tr class="light">
      <td>palevioletred</td>
      <td>rgb(219,112,147)</td>
      <td>hsl(340,59.8%,64.9%)</td>
      <td>#DB7093</td>
    </tr>

    <tr class="light">
      <td>papayawhip</td>
      <td>rgb(255,239,213)</td>
      <td>hsl(37,100%,91.8%)</td>
      <td>#FFEFD5</td>
    </tr>

    <tr class="light">
      <td>peachpuff</td>
      <td>rgb(255,218,185)</td>
      <td>hsl(28,100%,86.3%)</td>
      <td>#FFDAB9</td>
    </tr>

    <tr class="light">
      <td>peru</td>
      <td>rgb(205,133,63)</td>
      <td>hsl(30,58.7%,52.5%)</td>
      <td>#CD853F</td>
    </tr>

    <tr class="light">
      <td>pink</td>
      <td>rgb(255,192,203)</td>
      <td>hsl(350,100%,87.6%)</td>
      <td>#FFC0CB</td>
    </tr>

    <tr class="light">
      <td>plum</td>
      <td>rgb(221,160,221)</td>
      <td>hsl(300,47.3%,74.7%)</td>
      <td>#DDA0DD</td>
    </tr>

    <tr class="light">
      <td>powderblue</td>
      <td>rgb(176,224,230)</td>
      <td>hsl(187,51.9%,79.6%)</td>
      <td>#B0E0E6</td>
    </tr>

    <tr class="dark">
      <td>purple</td>
      <td>rgb(128,0,128)</td>
      <td>hsl(300,100%,25.1%)</td>
      <td>#800080</td>
    </tr>

    <tr class="dark">
      <td>rebeccapurple</td>
      <td>rgb(102,51,153)</td>
      <td>hsl(270,50%,40%)</td>
      <td>#663399</td>
    </tr>

    <tr class="dark">
      <td>red</td>
      <td>rgb(255,0,0)</td>
      <td>hsl(0,100%,50%)</td>
      <td>#FF0000</td>
    </tr>

    <tr class="light">
      <td>rosybrown</td>
      <td>rgb(188,143,143)</td>
      <td>hsl(0,25.1%,64.9%)</td>
      <td>#BC8F8F</td>
    </tr>

    <tr class="dark">
      <td>royalblue</td>
      <td>rgb(65,105,225)</td>
      <td>hsl(225,72.7%,56.9%)</td>
      <td>#4169E1</td>
    </tr>

    <tr class="dark">
      <td>saddlebrown</td>
      <td>rgb(139,69,19)</td>
      <td>hsl(25,75.9%,31%)</td>
      <td>#8B4513</td>
    </tr>

    <tr class="light">
      <td>salmon</td>
      <td>rgb(250,128,114)</td>
      <td>hsl(6,93.2%,71.4%)</td>
      <td>#FA8072</td>
    </tr>

    <tr class="light">
      <td>sandybrown</td>
      <td>rgb(244,164,96)</td>
      <td>hsl(28,87.1%,66.7%)</td>
      <td>#F4A460</td>
    </tr>

    <tr class="dark">
      <td>seagreen</td>
      <td>rgb(46,139,87)</td>
      <td>hsl(146,50.3%,36.3%)</td>
      <td>#2E8B57</td>
    </tr>

    <tr class="light">
      <td>seashell</td>
      <td>rgb(255,245,238)</td>
      <td>hsl(25,100%,96.7%)</td>
      <td>#FFF5EE</td>
    </tr>

    <tr class="dark">
      <td>sienna</td>
      <td>rgb(160,82,45)</td>
      <td>hsl(19,56.1%,40.2%)</td>
      <td>#A0522D</td>
    </tr>

    <tr class="light">
      <td>silver</td>
      <td>rgb(192,192,192)</td>
      <td>hsl(0,0%,75.3%)</td>
      <td>#C0C0C0</td>
    </tr>

    <tr class="light">
      <td>skyblue</td>
      <td>rgb(135,206,235)</td>
      <td>hsl(197,71.4%,72.5%)</td>
      <td>#87CEEB</td>
    </tr>

    <tr class="dark">
      <td>slateblue</td>
      <td>rgb(106,90,205)</td>
      <td>hsl(248,53.5%,57.8%)</td>
      <td>#6A5ACD</td>
    </tr>

    <tr class="dark">
      <td>slategray</td>
      <td>rgb(112,128,144)</td>
      <td>hsl(210,12.6%,50.2%)</td>
      <td>#708090</td>
      <td>slategrey</td>
    </tr>
    <tr class="dark">
      <td>slategrey</td>
      <td>rgb(112,128,144)</td>
      <td>hsl(210,12.6%,50.2%)</td>
      <td>#708090</td>
    </tr>

    <tr class="light">
      <td>snow</td>
      <td>rgb(255,250,250)</td>
      <td>hsl(0,100%,99%)</td>
      <td>#FFFAFA</td>
    </tr>

    <tr class="light">
      <td>springgreen</td>
      <td>rgb(0,255,127)</td>
      <td>hsl(150,100%,50%)</td>
      <td>#00FF7F</td>
    </tr>

    <tr class="dark">
      <td>steelblue</td>
      <td>rgb(70,130,180)</td>
      <td>hsl(207,44%,49%)</td>
      <td>#4682B4</td>
    </tr>

    <tr class="light">
      <td>tan</td>
      <td>rgb(210,180,140)</td>
      <td>hsl(34,43.8%,68.6%)</td>
      <td>#D2B48C</td>
    </tr>

    <tr class="dark">
      <td>teal</td>
      <td>rgb(0,128,128)</td>
      <td>hsl(180,100%,25.1%)</td>
      <td>#008080</td>
    </tr>

    <tr class="light">
      <td>thistle</td>
      <td>rgb(216,191,216)</td>
      <td>hsl(300,24.3%,79.8%)</td>
      <td>#D8BFD8</td>
    </tr>

    <tr class="light">
      <td>tomato</td>
      <td>rgb(255,99,71)</td>
      <td>hsl(9,100%,63.9%)</td>
      <td>#FF6347</td>
    </tr>

    <tr class="light">
      <td>turquoise</td>
      <td>rgb(64,224,208)</td>
      <td>hsl(174,72.1%,56.5%)</td>
      <td>#40E0D0</td>
    </tr>

    <tr class="light">
      <td>violet</td>
      <td>rgb(238,130,238)</td>
      <td>hsl(300,76.1%,72.2%)</td>
      <td>#EE82EE</td>
    </tr>

    <tr class="light">
      <td>wheat</td>
      <td>rgb(245,222,179)</td>
      <td>hsl(39,76.7%,83.1%)</td>
      <td>#F5DEB3</td>
    </tr>

    <tr class="light">
      <td>white</td>
      <td>rgb(255,255,255)</td>
      <td>hsl(0,0%,100%)</td>
      <td>#FFFFFF</td>
    </tr>

    <tr class="light">
      <td>whitesmoke</td>
      <td>rgb(245,245,245)</td>
      <td>hsl(0,0%,96.1%)</td>
      <td>#F5F5F5</td>
    </tr>

    <tr class="light">
      <td>yellow</td>
      <td>rgb(255,255,0)</td>
      <td>hsl(60,100%,50%)</td>
      <td>#FFFF00</td>
    </tr>

    <tr class="light">
      <td>yellowgreen</td>
      <td>rgb(154,205,50)</td>
      <td>hsl(80,60.8%,50%)</td>
      <td>#9ACD32</td>
    </tr>
  </tbody>
</table>
              
            
!

CSS

              
                @mixin slider-thumb {
  appearance: none;
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: linear-gradient(
    120deg,
    #444 30%,
    #111 100%
  );
  box-shadow:
    0 0 0 2px white,
    0 0 2px 3px #444;
  transition: all .3s;
}

@mixin non-mono-slider-thumb-focus {
  background: linear-gradient(
    120deg,
    hsl( calc(var(--pos) * 360), 90%, 50% ) 30%,
    hsl( calc(var(--pos) * 360), 100%, 40% ) 100%
  );
  box-shadow:
    0 0 0 3px white,
    0 0 2px 4px hsl( calc(var(--pos) * 360), 100%, 50% );
}

@mixin button-reset {
  appearance: none;
  background: none;
  border: none;
  color: inherit;
  margin: 0;
}

:root {
  --show-info-duration: .3s;
}

body {
  --content-width: max(400px, min(80vmin, 800px));
  --font-size: max(14px, min(3vmin, 20px));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font: normal var(--font-size)/1.4 helvetica, sans-serif;
}

.hidden {
  display: none !important;
}

.back-icon {
  width: 16px;
  height: 16px;
}

.github-icon {
  width: 24px;
  height: 24px;
}

.github-link {
  position: absolute;
  top: .5em;
  right: .5em;
  opacity: .7;

  &:hover, &:focus {
    opacity: 1;
  }
}

#colorsTable {
  display: none;
}

.container {
  position: relative;
  padding: 2vmin;
  top: -2vmin;
  left: -2vmin;
}

.hue-control {
  display: flex;
  flex-direction: column;
  width: var(--content-width);
  margin-bottom: 1.5vmin;
  font-size: .8em;

  &-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 1.1em;
    margin-bottom: .75vmin;
  }
}

.hue-value {
  display: inline-block;
  min-width: 4vmin;
  text-align: center;
}

.tolerance-text {
  font-size: .8em;
  color: #333;
}

.hue-slider {
  appearance: none;
  outline: none;
  position: relative;
  flex: 1;
  height: 8px;
  margin-left: 2vmin;
  border-radius: 5px;
  transition: all .3s;
  background: linear-gradient(
    to right,
    hsl(0, 80%, 70%) 0%,
    hsl(30, 80%, 70%) 8.3%,
    hsl(60, 80%, 70%) 16.6%,
    hsl(90, 80%, 70%) 25%,
    hsl(120, 80%, 70%) 33.3%,
    hsl(150, 80%, 70%) 41.6%,
    hsl(180, 80%, 70%) 50%,
    hsl(210, 80%, 70%) 58.3%,
    hsl(240, 80%, 70%) 66.6%,
    hsl(270, 80%, 70%) 75%,
    hsl(300, 80%, 70%) 83.3%,
    hsl(330, 80%, 70%) 91.6%,
    hsl(360, 80%, 70%) 100%
  );

  &.mono {
    background: linear-gradient(
      to bottom,
      #444 0%,
      #111 100%
    );
  }

  &:not(.mono):focus {
    height: 10px;
    background: linear-gradient(
      to right,
      hsl(0, 100%, 50%) 0%,
      hsl(30, 100%, 50%) 8.3%,
      hsl(60, 100%, 50%) 16.6%,
      hsl(90, 100%, 50%) 25%,
      hsl(120, 100%, 50%) 33.3%,
      hsl(150, 100%, 50%) 41.6%,
      hsl(180, 100%, 50%) 50%,
      hsl(210, 100%, 50%) 58.3%,
      hsl(240, 100%, 50%) 66.6%,
      hsl(270, 100%, 50%) 75%,
      hsl(300, 100%, 50%) 83.3%,
      hsl(330, 100%, 50%) 91.6%,
      hsl(360, 100%, 50%) 100%
    );
  }

  &::-webkit-slider-thumb {
    @include slider-thumb;
  }

  &::-moz-range-thumb {
    @include slider-thumb;
  }

  &:not(.mono):focus::-webkit-slider-thumb {
    @include non-mono-slider-thumb-focus;
  }

  &:not(.mono):focus::-moz-range-thumb {
    @include non-mono-slider-thumb-focus;
  }
}

.mono-toggle {
  @include button-reset;
  outline: none;

  width: 15px;
  height: 15px;
  margin-left: 2vmin;
  border-radius: 50%;
  transition: background-position .2s;
  cursor: pointer;
  background-size: 200%;
  background-image: linear-gradient(
    to right,
    white 24%,
    #777 28%,
    #777 70%,
    white 74%
  );
  box-shadow:
    0 0 0 1.5px white,
    0 0 0 3px #777;

  &:hover {
    background-image: linear-gradient(
      to right,
      white 24%,
      #333 28%,
      #333 70%,
      white 74%
    );
    box-shadow:
      0 0 0 1.5px white,
      0 0 0 3px #333;
  }

  &:active {
    background-image: linear-gradient(
      to right,
      #f5f5f5 24%,
      #888 28%,
      #888 70%,
      #f5f5f5 74%
    );
    box-shadow:
      0 0 0 1.5px white,
      0 0 0 3px #888;
  }

  &:checked,
  &:checked:active {
    background-position: 89% 0;
    background-image: linear-gradient(
      to right,
      white 24%,
      black 28%,
      black 70%,
      white 74%
    );
    box-shadow:
      0 0 0 1.5px white,
      0 0 0 3px black;
  }

  &:focus {
    box-shadow:
      0 0 0 1.5px white,
      0 0 0 3px #333,
      0 0 2.25px 6px rgba(black, .125);
  }

  &:checked:focus {
    box-shadow:
      0 0 0 1.5px white,
      0 0 0 3px black,
      0 0 2.25px 6px rgba(black, .25);
  }
}

.chart-container {
  position: relative;
  width: var(--content-width);
  height: var(--content-width);
}

.chart {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;

  @supports (grid-auto-flow: row) {
    display: grid;
    grid-auto-flow: row;
  }

  &.contain {
    overflow: hidden;
  }

  .row {
    flex: 1;
    display: flex;

    @supports (grid-auto-flow: row) {
      display: grid;
      grid-auto-flow: column;
    }

    .color-button {
      @include button-reset;

      flex: 1;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: .6em;
      text-transform: uppercase;
      letter-spacing: .125em;
      background: var(--background);
      color: var(--color);
      user-select: none;
      cursor: pointer;
      transition: transform .2s;

      &:hover, &:focus {
        outline: none;
        transform: scale(1.04);
        box-shadow: 3px 3px 10px rgba(#000, .125);
      }
      
      &:active {
        transform: scale(1.02);
        box-shadow: 1px 1px 5px rgba(#000, .125);
      }

      &.active {
        transition: transform .6s;
      }

      &.active,
      &.deactivating {
        transform: scale(16);
        color: transparent;
      }

      &.deactivating {
        animation: deactivate forwards calc(2 * var(--show-info-duration));
      }

      @keyframes deactivate {
        from, 70% {
          color: transparent;
        }
        to {
          color: var(--color);
          transform: scale(1);
        }
      }
    }
  }
}

.color-info {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-5%) scale(.8);
  transition:
    opacity var(--show-info-duration),
    transform var(--show-info-duration);

  &.active {
    width: 100%;
    height: 100%;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: var(--show-info-duration);
  }

  &-container {
    --info-padding: 3em;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    padding: var(--info-padding);
    box-sizing: border-box;
    border: 1px solid;
    font-size: .8em;
    color: var(--color);
    border-color: var(--color);
  }

  &-name {
    font-size: 3em;
    font-weight: 100;
    line-height: 1.3;
    margin-bottom: .33em;
    overflow: hidden;
    outline: none;
  }

  .marquee {
    display: inline-block;
    animation: marquee 4s 1s infinite;
  }

  @keyframes marquee {
    from, 12%, 88%, to {
      transform: translateX(0);
    }
    48%, 52% {
      background: transparent;
      transform: translateX(
        calc( var(--marquee-amount) - .1em )
      );
    }
  }

  &-row {
    font-size: 1.4em;
    font-weight: 100;
    margin-bottom: .33rem;
    outline: none;
    
    &--alter {
      font-size: 1.8em;
    }

    &--hex {}
  }

  &-close-button {
    @include button-reset;

    position: absolute;
    bottom: 1em;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    font-size: 1.25em;
    cursor: pointer;
    transition: all .3s;

    &:hover, &:focus {
      padding-right: 1em;
    }

    .back-icon {
      margin-right: .25em;
    }
  }
}

.axis {
  font-size: .5em;
  letter-spacing: .25em;
  text-align: center;
  text-transform: uppercase;

  &::before, &::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 33%;
    height: 1px;
    background: #aaa;
  }

  &::before {
    left: 0;
  }

  &::after {
    right: 0;
  }
}

.lightness-axis {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  transform-origin: top right;
  transform:
    rotate(-90deg)
    translateY(200%)
    rotate(180deg)
    translateX(100%);
}

.saturation-axis {
  position: relative;
  transform: translateY(100%);
}
              
            
!

JS

              
                const { abs, floor, random } = Math

const randomFrom = array => array[floor(random() * array.length)]

const getNumbers = n => [...Array(n).keys()]

const wait = duration => new Promise(resolve => {
  setTimeout(resolve, duration)
})

const query = (selector, parent = document) =>
  parent.querySelector.call(parent, selector)

const queryAll = (selector, parent = document) =>
  Array.from(parent.querySelectorAll.call(parent, selector))

const queryId = document.getElementById.bind(document)

const parseDataFromTable = (tableID) => {
  const table = queryId(tableID)
  const headers = queryAll('thead th', table)
  const values = queryAll('tbody tr', table)

  const columns = headers.map(header => ({
    id: header.id,
    name: header.innerText
  }))

  const rows = values.map(value => {
    const cells = queryAll('td', value)
    return cells.reduce((row, cell, colIndex) => {
      const columnId = columns[colIndex].id
      return {
        ...row,
        [columnId]: cell.innerText
      }
    }, {
      type: value.getAttribute('class')
    })
  })

  return {
    columns,
    rows
  }
}

/*
 * For each color in colorList, check if there's an equivalent color
 * with a different name.
 * Eliminate the non-preferred colors that have equivalents.
 * A color can be thought "preferred", if it has `alternativeName` field in it.
 * e.g. Eliminates fuchsia and aqua in favor of magenta and cyan, respectively.
 */
const removeAlternativeColors = colorList => {
  return colorList.map((color, index) => {
    const equivalent = colorList.find(c => c !== color && c.hex === color.hex)
    if (!equivalent || color.alternativeName === equivalent.name) {
      return color
    }
    return null
  }).filter(c => !!c)
}

const parseColorStrings = color => ({
  ...color,
  rgb: color.rgb.match(/rgb\((\d+),(\d+),(\d+)\)/).slice(1).map(Number),
  hsl: color.hsl.match(/hsl\((.*),(.*)%,(.*)%\)/).slice(1).map(Number)
})

const isMonochrome = color => color.hsl[1] === 0
const isNonMonochrome = color => !isMonochrome(color)

const filterColorsByHue = (colorList, hue, tolerance) => {
  const colors = colorList.filter(color =>  abs(hue - color.hsl[0]) < tolerance)
  if (colors.length) {
    return {
      list: colors,
      tolerance
    } 
  }
  return filterColorsByHue(colorList, hue, tolerance + 1)
}

const groupColorsByLightness = (colorList, tolerance) => {
  return getNumbers(100 / tolerance + 1).map(t =>
    colorList.filter(color => {
      const difference = 100 - color.hsl[2] - t * tolerance
      const differenceLimit = tolerance / 2
      if (abs(difference) === differenceLimit) {
        return difference > 0
      }
      return abs(difference) < differenceLimit
    })
  )
}

const groupColors = ({ colorList, hue, tolerance, mono }) => {
  const baseColors = colorList.filter(mono ? isMonochrome : isNonMonochrome)
  const sortedColors = [...baseColors].sort((a, b) => a.hsl[1] - b.hsl[1])
  
  const colorsFilteredByHue = filterColorsByHue(sortedColors, hue, tolerance.min)
  
  const lightnessGroups = groupColorsByLightness(colorsFilteredByHue.list, tolerance.min)

  const finalColorsList = lightnessGroups.filter(group => !!group.length)
  
  return {
    list: finalColorsList,
    tolerance: colorsFilteredByHue.tolerance
  }
}

const colorsData = parseDataFromTable('colorsTable')
const uniqueColors = removeAlternativeColors(colorsData.rows)
const parsedUniqueColors = uniqueColors.map(parseColorStrings)

const createState = (initialState, onChange) => {
  return {
    state: initialState,
    setState(newState) {
      this.state = Object.assign({}, this.state, newState)
      onChange(this.state)
    }
  }
}

const dom = {
  chart: queryId('chart'),
  chartContainer: queryId('chart-container'),
  hueSlider: queryId('hue-slider'),
  hueValueDisplay: queryId('hue-value'),
  toleranceText: queryId('tolerance-text'),
  toleranceValueDisplay: queryId('tolerance-value'),
  monoToggle: queryId('mono-toggle'),
  colorInfo: queryId('color-info'),
  saturationAxis: queryId('saturation-axis')
}

const render = (state) => {
  const { hue, mono } = state

  const colorList = groupColors({
    colorList: parsedUniqueColors,
    tolerance: {
      min: 5
    },
    hue,
    mono
  })

  const html = colorList.list.map(lightnessGroup => `
    <div class="row">
      ${lightnessGroup.map(({ name, type}) => {
        const CSSProperties = [
          `--background: ${name}`,
          `--color: ${type === 'light' ? 'black' : 'white'}`
        ]

        return `
          <button
            type="button"
            class="color-button"
            id="${name}"
            style="${CSSProperties.join(';')}"
          >
            ${name}
          </button>
        `
      }).join('')}
    </div>
  `).join('')

  const sliderPos = hue / 360

  dom.hueSlider.classList.toggle('mono', !!mono)
  dom.toleranceText.classList.toggle('hidden', !!mono)
  dom.saturationAxis.classList.toggle('hidden', !!mono)
  if (mono) {
    dom.hueValueDisplay.innerText = 0
  } else {
    dom.hueValueDisplay.innerText = hue
  }

  dom.hueSlider.style.setProperty('--pos', sliderPos)
  dom.hueSlider.value = hue
  dom.toleranceValueDisplay.innerHTML = colorList.tolerance
  dom.chart.innerHTML = html
}

const formatRGB = rgb => `rgb(${rgb.join(', ')})`

const formatHSL = hsl => `hsl(${hsl.map((_, i) => i === 0 ? _ : `${_}%`).join(', ')})`

const renderColorInfo = color => {
  const { type, name, alternativeName, rgb, hsl, hex } = color

  const CSSProperties = [
    `--background: ${name}`,
    `--color: ${type === 'light' ? 'black' : 'white'}`
  ]

  dom.colorInfo.innerHTML = `
    <div class="color-info-container" style="${CSSProperties.join(';')}">
      <h1 class="selectable color-info-name" tabindex="0">
        <span class="marquee">${name}</span>
      </h1>

      ${color.alternativeName ? `
        <p class="color-info-row color-info-row--alter" tabindex="0">
          or <span class="selectable">${color.alternativeName}</span>
        </p>
      `: ''}

      <p class="selectable color-info-row color-info-row--hex" tabindex="0">
        ${color.hex}
      </p>

      <p class="selectable color-info-row color-info-row--rgb" tabindex="0">
        ${formatRGB(color.rgb)}
      </p>

      <p class="selectable color-info-row color-info-row--hsl" tabindex="0">
        ${formatHSL(color.hsl)}
      </p>

      <button
        type="button"
        class="color-info-close-button"
        id="close-color-info"
      >
        <svg class="back-icon" role="img" alt="back icon">
          <use xlink:href="#back-icon"></use>
        </svg>
        back
      </button>
    </div>
  `

  const container = query('.color-info-container', dom.colorInfo)

  const closeButton = query('#close-color-info', container)
  closeButton.addEventListener('click', () => hideColorInfo(true))

  queryAll('.selectable', container).forEach(el => {
    el.addEventListener('click', () => select(el))
    el.addEventListener('focus', () => select(el))
  })

  wait(1000).then(() => {
    const computedStyle = getComputedStyle(container)
    const width = parseFloat(computedStyle.width)
    const paddingLeft = parseFloat(computedStyle.paddingLeft)
    const paddingRight = parseFloat(computedStyle.paddingRight)
    const containerWidth = width - (paddingLeft + paddingRight)
    queryAll('.marquee', dom.colorInfo).forEach(el => {
      const width = el.offsetWidth
      const widthDiff = containerWidth - width
      if (widthDiff >= 0) {
        el.classList.remove('marquee')
        return
      }
      el.style.setProperty('--marquee-amount', `${widthDiff}px`)
    })
  })
}

const showColorInfo = e => {
  if (query('.deactivating', dom.chartContainer)) {
    return
  }

  dom.chart.inert = true
  dom.colorInfo.inert = false
  dom.chart.classList.add('contain')
  e.target.classList.add('active')

  const color = parsedUniqueColors.find(c => c.name === e.target.id)
  renderColorInfo(color)
  dom.colorInfo.classList.add('active')
}

/*
 * Can be triggered by:
 * - Clicking on close button in colorInfo
 * - Pressing ESC
 * - Changing hue while colorInfo is open
 *   This scenario requires checking if activeColorButton exists.
 */
const hideColorInfo = shouldFocusBack => {
  dom.chart.inert = false
  dom.colorInfo.inert = true
  dom.colorInfo.classList.add('deactivating')
  dom.colorInfo.classList.remove('active')
  const activeColorButton = query('.color-button.active', dom.chart)
  if (activeColorButton) {
    activeColorButton.classList.add('deactivating')
    activeColorButton.classList.remove('active')
  }

  wait(600).then(() => {
    dom.colorInfo.classList.remove('deactivating')

    // Last clicked color is still there. e.g. hue didn't change
    if (activeColorButton) {
      dom.chart.classList.remove('contain')

      /*
       * The crazy reason why we need to clone an element
       * with one className lacking, instead of just
       * removing that className from the existing element is:
       * Some mobile browsers and some (I guess) old versions
       * of Safari fucks up the animation. They run
       * "deactivate" keyframes upon className removal ¯\_(ツ)_/¯
       * When we do it this way and do it with some async
       * involved, it works properly.
       */
      const newActiveColorButton = activeColorButton.cloneNode(true)
      newActiveColorButton.classList.remove('deactivating')
      requestAnimationFrame(() => {
        if (activeColorButton) {
          activeColorButton.replaceWith(newActiveColorButton)
          if (shouldFocusBack) {
            newActiveColorButton.focus()
          }
        }
      })
    }
  })
}

const exampleHues = [13, 25, 36, 47, 105, 150, 178, 210, 240, 297, 336, 350]

const ui = createState({
  hue: randomFrom(exampleHues),
  mono: false
}, render)

render(ui.state)

dom.monoToggle.addEventListener('change', e => {
  ui.setState({
    mono: e.target.checked,
    prevHue: ui.state.hue,
    hue: e.target.checked ? 0 : ui.state.prevHue
  })
  hideColorInfo()
})

dom.hueSlider.addEventListener('input', e => {
  ui.setState({
    hue: Number(e.target.value),
  })
  hideColorInfo()
})

dom.chart.addEventListener('click', showColorInfo)

const keyCodeGetter = () => {
  const KEYS = {
    27: 'escape'
  }

  return event => KEYS[event.which] || KEYS[event.keyCode]
}

const getKeyCode = keyCodeGetter()

window.addEventListener('keyup', e => {
  switch (getKeyCode(e)) {
    case 'escape':
      if (dom.colorInfo.classList.contains('active')) {
        hideColorInfo(true)
      }
  }
})
              
            
!
999px

Console