Skip to main content

Kleur: HSLuv based color utils & palette generators

Poetry PyPI - Version PyPI - Python Versions

I'd like to give special credits to Alexei Boronine and everyone else who contributed to the HSLuv project. This work provided the fundaments to build this package on (and is the only dependency used in it).

Palette Command Shades Command

Installation

pip install kleur

Library usage

When used as a dependency the kleur package contains convenience wrappers around the HSLuv Python API, as well as utilities for styling console ouput built on top of it.

(API reference to be added)

Command line usage

Preview a color palette

General help

$ kleur palette -h
usage: kleur palette [-h] [-c NAME=HUE (1-360) [NAME=HUE (1-360) ...]]
[-m] [-a] [-s NUMBER_OF_SHADES] [-v NUMBER_OF_VIBRANCES]

options:
  -h, --help            show this help message and exit
  -c, --colors NAME=HUE (1-360) [NAME=HUE (1-360) ...]
  -m, --merge-with-default-palette
  -a, --alt-default-palette
  -s, --number-of-shades NUMBER_OF_SHADES
  -v, --number-of-vibrances NUMBER_OF_VIBRANCES

Preview default palette

$ kleur palette

alt text

Preview custom palette

$ kleur palette -c green=143 blue=257 tomato=21 violet=273

alt text

Preview custom palette merged with default palette

$ kleur palette -c green=143 blue=257 tomato=21 violet=273 -m

alt text

Generate shades (as CSS variables), based one 1 or 2 (hex) colors

General help

$ kleur shades -h
usage: kleur shades [-h] [-l LABEL] -c COLOR1 [-k COLOR2]
[-s NUMBER_OF_SHADES] [-b] [-i] [-d DYNAMIC_RANGE]

options:
  -h, --help            show this help message and exit
  -l, --label LABEL
  -c, --color1 COLOR1
  -k, --color2 COLOR2
  -s, --number-of-shades NUMBER_OF_SHADES
  -b, --include-black-and-white
  -i, --include-input-shades
  -d, --dynamic-range DYNAMIC_RANGE

Based on one input color

$ kleur shades -l tables -c 7ab1e5

alt text

With input markers:

$ kleur shades -l tables -c 7ab1e5 -i

alt text

Based on two input colors

The dynamic range specifies to what degree the hue of the input colors will be used as boundaries:

  • Dynamic range 0 (0%):

    The shades will interpolate (or extrapolate) between the input colors.

  • Dynamic range between 0 and 1 (between 0% and 100%):

    The shades will interpolate (or extrapolate) between darker / brighter shades of the input colors.

  • Dynamic range 1 (100%):

    The shades will interpolate between the darkest & brightest shades of the input colors.

$ kleur shades -l tables-fables -c 7a6135 -k fab1e5 -d 66

alt text

With input markers, varying in dynamic range:

$ kleur shades -l tables-fables -c 7a6135 -k fab1e5 -d 0 -i

alt text

$ kleur shades -l tables-fables -c 7a6135 -k fab1e5 -d 50 -i

alt text

$ kleur shades -l tables-fables -c 7a6135 -k fab1e5 -d 100 -i

alt text

Metadata

Release files for kleur 2.0.12

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

Source distribution (sdist)

Source distribution for kleur 2.0.12
File Size Uploaded Provenance Actions
kleur-2.0.12.tar.gz 11.2 kB With provenance Details for kleur-2.0.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kleur 2.0.12
File Interpreter ABI Platform Actions
kleur-2.0.12-py3-none-any.whl Python 3 none any Details for kleur-2.0.12-py3-none-any.whl

Total release size: 24.5 kB

Release files / kleur-2.0.12.tar.gz

Download URL kleur-2.0.12.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f963cee6b139e5647ce131c9c9577ed1029701ae302c7fe51c06a0b98590d97d
BLAKE2b-256 checksum
How to use checksums
920afd4b4bfe943331f4b3e49e30a57d5fc63eb25af801e58fcae09b1cfe9cbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 9, 2026.

Transparency log

Release files / kleur-2.0.12-py3-none-any.whl

Download URL kleur-2.0.12-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1142ae63c3b73a49d7a5d5f2981c05c4de09f9bd1d98de8ab2d7e84035e1796
BLAKE2b-256 checksum
How to use checksums
50e66807114fc09c2862df13a8590b2a98ac6cf5a8e04badcc45209f31239b8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 9, 2026.

Transparency log

Security for kleur 2.0.12

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kleur-2.0.12.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 Mar 9, 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.

Release history Release notifications | RSS feed

This release

2.0.12 This release

2 release files Full provenance

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