<div class="row">
    <div class="col c7">
        <h1 id="implementations">Implementations</h1>
        <p>
            The <a href="https://github.com/hsluv/hsluv">reference implementation</a> is written in Haxe
            and released under the MIT license. Check the individual ports for documentation and licensing.
            The math is available under the public domain.
        </p>
        <h2>Porting</h2>
        <p>
            Every implementation of HSLuv must provide the following four functions:
        </p>
        <pre>hsluvToRgb([H, S, L]) -> [R, G, B]
hpluvToRgb([H, S, L]) -> [R, G, B]
rgbToHsluv([R, G, B]) -> [H, S, L]
rgbToHpluv([R, G, B]) -> [H, S, L]</pre>
        <p>
            These functions are implemented as a chain of color space transformations: RGB to
            <a href="https://en.wikipedia.org/wiki/CIE_1931_color_space">CIE&nbsp;XYZ</a> to
            <a href="https://en.wikipedia.org/wiki/CIELUV">CIELUV</a> to CIELUV&nbsp;LCh
            to HSLuv and HPLuv.
        </p>
        <p>
            If you want to port HSLuv to a different language or finish one of the started ports, you should
            test your implementation against a JSON snapshot of the color space generated from the reference
            implementation. The snapshots are <a href="https://github.com/hsluv/hsluv/tree/master/snapshots">
            stored in the repo</a>. Apart from corresponding RGB and HSLuv values, the snapshots also provide
            all the intermediate values in the chain of transformations. As such, they can be a useful tool
            for debugging.
        </p>
        <p>
            Contact the original author by <a href="mailto:alexei@boronine.com">email</a>.
        </p>
    </div>
    <aside class="col c5">
        <table class="table">
            <tr>
                <th></th>
                <th>Testing</th>
                <th>Package</th>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-c">
                        C
                    </a>
                </th>
                <td>
                    <a href="https://github.com/hsluv/hsluv-c/actions/workflows/test.yml">
                        <img alt="CI" src="https://github.com/hsluv/hsluv-c/actions/workflows/test.yml/badge.svg"/>
                    </a>
                </td>
                <td></td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-csharp">
                        C#
                    </a>
                </th>
                <td>
                    <a href="https://github.com/hsluv/hsluv-csharp/actions/workflows/test.yml">
                        <img alt="CI" src="https://github.com/hsluv/hsluv-csharp/actions/workflows/test.yml/badge.svg"/>
                    </a>
                </td>
                <td>
                    <a href="https://www.nuget.org/packages/Hsluv">
                        <img alt="CI" src="https://img.shields.io/nuget/v/Hsluv.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-crystal">
                        Crystal
                    </a>
                </th>
                <td>
                    <a href="https://github.com/hsluv/hsluv-crystal/actions/workflows/crystal.yml">
                        <img alt="CI" src="https://github.com/hsluv/hsluv-crystal/actions/workflows/crystal.yml/badge.svg"/>
                    </a>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/bernaferrari/hsluv-dart">
                        Dart
                    </a>
                </th>
                <td>
                </td>
                <td>
                    <a href="https://pub.dev/packages/hsluv">
                        <img alt="CI" src="https://img.shields.io/pub/v/hsluv"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://git.goyman.com/kuon/ex-hsluv">
                        Elixir
                    </a>
                </th>
                <td>
                </td>
                <td>
                    <a href="https://hex.pm/packages/hsluv">
                        <img alt="CI" src="https://img.shields.io/hexpm/v/hsluv"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/kuon/elm-hsluv">
                        Elm
                    </a>
                </th>
                <td>
                    <a href="https://travis-ci.org/kuon/elm-hsluv">
                        <img alt="CI" src="https://travis-ci.org/kuon/elm-hsluv.svg?branch=master"/>
                    </a>
                </td>
                <td>
                    <a href="http://package.elm-lang.org/packages/kuon/elm-hsluv/latest">
                        <img alt="CI" src="https://img.shields.io/badge/elm-package-blue.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-emacs">
                        Emacs
                    </a>
                </th>
                <td>
                </td>
                <td>
                    <a href="https://melpa.org/#/hsluv">
                        <img alt="CI" src="https://melpa.org/packages/hsluv-badge.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/ElectronicBlueberry/gdscript-hsluv">
                        GDScript
                    </a>
                </th>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/williammalo/hsluv-glsl">
                        GLSL
                    </a>
                </th>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <th>
                    <a href="https://git.modalduality.org/hsluv-haskell/tree/">
                        Haskell
                    </a>
                </th>
                <td>
                </td>
                <td>
                    <a href="https://hackage.haskell.org/package/hsluv-haskell">
                        <img alt="CI" src="https://img.shields.io/hackage/v/hsluv-haskell.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-haxe">
                        Haxe
                    </a>
                </th>
                <td>
                    <a href="https://github.com/hsluv/hsluv-haxe/actions/workflows/test.yml">
                        <img alt="CI" src="https://github.com/hsluv/hsluv-haxe/actions/workflows/test.yml/badge.svg"/>
                    </a>
                </td>
                <td>
                    <a href="https://lib.haxe.org/p/hsluv">
                        <img alt="CI" src="https://img.shields.io/badge/haxelib-0.1.0-blue.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-go">
                        Go
                    </a>
                </th>
                <td>
                    <a href="https://github.com/hsluv/hsluv-go/actions/workflows/test.yml">
                        <img alt="CI" src="https://github.com/hsluv/hsluv-go/actions/workflows/test.yml/badge.svg"/>
                    </a>
                </td>
                <td></td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-java">
                        Java
                    </a>
                </th>
                <td>
                    <a href="https://github.com/hsluv/hsluv-java/actions/workflows/test.yml">
                        <img alt="CI" src="https://github.com/hsluv/hsluv-java/actions/workflows/test.yml/badge.svg"/>
                    </a>
                </td>
                <td>
                    <a href="https://central.sonatype.com/artifact/org.hsluv/hsluv">
                        <img alt="CI" src="https://img.shields.io/maven-central/v/org.hsluv/hsluv.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-javascript">
                        JavaScript
                    </a>
                </th>
                <td>
                    <a href="https://github.com/hsluv/hsluv-javascript/actions/workflows/nodeci.yml">
                        <img alt="CI" src="https://github.com/hsluv/hsluv-javascript/actions/workflows/nodeci.yml/badge.svg"/>
                    </a>
                </td>
                <td>
                    <a href="https://www.npmjs.com/package/hsluv">
                        <img alt="CI" src="https://img.shields.io/npm/v/hsluv.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-lua">
                        Lua
                    </a>
                </th>
                <td>
                    <a href="https://github.com/hsluv/hsluv-lua/actions/workflows/test.yml">
                        <img alt="CI" src="https://github.com/hsluv/hsluv-lua/actions/workflows/test.yml/badge.svg"/>
                    </a>
                </td>
                <td>
                    <a href="https://luarocks.org/modules/hsluv/hsluv">
                        <img alt="CI" src="https://img.shields.io/badge/luarocks-0.1--0-blue.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-objc">
                        <nobr>Objective-C</nobr>
                    </a>
                </th>
                <td>
                    <a href="https://travis-ci.org/hsluv/hsluv-objc">
                        <img alt="CI" src="https://travis-ci.org/hsluv/hsluv-objc.svg?branch=master"/>
                    </a>
                </td>
                <td>
                    <a href="https://cocoapods.org/pods/hsluv-objc">
                        <img alt="CI" src="https://img.shields.io/cocoapods/v/hsluv-objc.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/sabine/hsluv-ocaml">
                        <nobr>OCaml</nobr>
                    </a>
                </th>
                <td></td>
                <td>
                    <a href="https://ocaml.org/p/hsluv/latest">
                        <img alt="package" src="https://img.shields.io/badge/ocaml.org-latest-blue"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://metacpan.org/release/Convert-Color-HUSL">
                        Perl
                    </a>
                </th>
                <td></td>
                <td>
                    <a href="https://metacpan.org/release/Convert-Color-HUSL">
                        <img alt="CI" src="https://img.shields.io/cpan/v/Convert-Color-HUSL.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-php">
                        PHP
                    </a>
                </th>
                <td>
                    <a href="https://github.com/hsluv/hsluv-php/actions/workflows/test.yml">
                        <img alt="CI" src="https://github.com/hsluv/hsluv-php/actions/workflows/test.yml/badge.svg"/>
                    </a>
                </td>
                <td></td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-python">
                        Python
                    </a>
                </th>
                <td>
                    <a href="https://github.com/hsluv/hsluv-python/actions/workflows/test.yml">
                        <img alt="CI" src="https://github.com/hsluv/hsluv-python/actions/workflows/test.yml/badge.svg"/>
                    </a>
                </td>
                <td>
                    <a href="https://pypi.python.org/pypi/hsluv/">
                        <img alt="CI" src="https://img.shields.io/pypi/v/hsluv.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-ruby">
                        Ruby
                    </a>
                </th>
                <td>
                    <a href="https://github.com/hsluv/hsluv-ruby/actions/workflows/ruby.yml">
                        <img alt="CI" src="https://github.com/hsluv/hsluv-ruby/actions/workflows/ruby.yml/badge.svg"/>
                    </a>
                </td>
                <td>
                    <a href="https://rubygems.org/gems/hsluv">
                        <img alt="CI" src="https://img.shields.io/gem/v/hsluv.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/dvdplm/rust-hsluv">
                        Rust
                    </a>
                </th>
                <td></td>
                <td>
                    <a href="https://crates.io/crates/rust-hsluv">
                        <img alt="CI" src="https://img.shields.io/crates/v/rust-hsluv.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-sass">
                        Sass
                    </a>
                </th>
                <td>
                    <a href="https://github.com/hsluv/hsluv-sass/actions/workflows/ci.yml">
                        <img alt="CI" src="https://github.com/hsluv/hsluv-sass/actions/workflows/ci.yml/badge.svg"/>
                    </a>
                </td>
                <td>
                    <a href="https://www.npmjs.com/package/hsluv-sass">
                        <img alt="CI" src="https://img.shields.io/npm/v/hsluv-sass.svg"/>
                    </a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="https://github.com/hsluv/hsluv-swift">
                        Swift
                    </a>
                </th>
                <td>
                    <a href="http://travis-ci.org/hsluv/hsluv-swift">
                        <img alt="CI" src="https://travis-ci.org/hsluv/hsluv-swift.svg?branch=master"/>
                    </a>
                </td>
                <td>
                    <a href="https://cocoapods.org/pods/HSLuvSwift">
                        <img alt="CI" src="https://img.shields.io/cocoapods/v/HSLuvSwift.svg"/>
                    </a>
                </td>
            </tr>
        </table>
    </aside>
</div>
