Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Build Status Package Version PyPI Downloads

A Python implementation of HSLuv (revision 4).

Installation

pip install hsluv

Python 2 users: pip install hsluv==5.0.0

Usage

This library does not hide (clamp) floating point error, e.g. you might receive a value outside of the expected range. If you wish to display the outputs of this library, consider rounding them for your purpose. The floating point error has not been quantified, but at least 10 decimal digits should be free of it.

hsluv_to_hex([hue, saturation, lightness])

hue is a float between 0 and 360, saturation and lightness are floats between 0 and 100. This function returns the resulting color as a hex string.

hsluv_to_rgb([hue, saturation, lightness])

Like above, but returns a list of 3 floats between 0 and 1, for each RGB channel.

hex_to_hsluv(hex)

Takes a hex string and returns the HSLuv color as a list of floats as defined above.

rgb_to_hsluv([red, green, blue])

Like above, but red, green and blue are passed as floats between 0 and 1.

For HPLuv (the pastel variant), use hpluv_to_hex, hpluv_to_rgb, hex_to_hpluv and rgb_to_hpluv.

Testing

Run python -m unittest discover -v.

Publishing to PyPI

  • On PyPI, open the hsluv project's Manage → Publishing page and configure a GitHub Trusted Publisher: owner hsluv, repository hsluv-python, workflow publish.yml.
  • Update __version__ in hsluv.py to an unused version (e.g. 5.0.5rc1 for a pre-release) and push the commit to the branch you want to publish.
  • Open Actions → Publish to PyPI → Run workflow, select that branch, and run it to build and upload to production PyPI. No tag or GitHub release is needed.
  • Verify the release on PyPI. Published versions cannot be reused.

Authors

Metadata

Release files for hsluv 5.0.5rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hsluv 5.0.5rc1
File Size Uploaded Provenance
hsluv-5.0.5rc1.tar.gz 541.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for hsluv 5.0.5rc1
File Interpreter ABI Platform
hsluv-5.0.5rc1-py3-none-any.whl Python 3 none any Details

Total release size: 547.3 kB

Release files / hsluv-5.0.5rc1.tar.gz

Download URL hsluv-5.0.5rc1.tar.gz
Size 541.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7a1d9abf1c7982d1858298a18cd5ec98e027d90a7749f9eb32e5301d3144241a
BLAKE2b-256 checksum
How to use checksums
ee809f4f4625cce303f40d0d864f5f54888a3880c3081cc536a2f62d166b50f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / hsluv-5.0.5rc1-py3-none-any.whl

Download URL hsluv-5.0.5rc1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df38c6ace078af03159524936bc8e808924175029bbdd63ae00bf057b9ae987c
BLAKE2b-256 checksum
How to use checksums
2691ead436fd54af7d59cfd60e5cc92346b5bdcb2c48e6191550abd05032983e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for hsluv 5.0.5rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hsluv-5.0.5rc1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page