Skip to main content

Color shades generator

Project description

Kleur: HSLuv based color utils & theme 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).

Installation

pip install kleur

Usage

Preview a color theme

General help

$ kleur theme -h
usage: kleur theme [-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-theme
  -a, --alt-default-theme
  -s, --number-of-shades NUMBER_OF_SHADES
  -v, --number-of-vibrances NUMBER_OF_VIBRANCES

Preview default theme

$ uv run kleur theme

alt text

Preview custom theme

$ kleur theme -c green=133 blue=257 tomato=20

alt text

Preview custom theme merged with default theme

$ kleur theme -c green=133 blue=257 tomato=20 -m

alt text

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

General help

usage: kleur css [-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 css -l tables -c 7ab1e5

alt text

With input markers:

$ kleur css -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 css -l bad-guy -c badddd -k aa601f -d 66

alt text

With input markers, varying in dynamic range:

$ kleur css -l bad-guy -c badddd -k aa601f -d 0 -i

alt text

$ kleur css -l bad-guy -c badddd -k aa601f -d 50 -i

alt text

$ kleur css -l bad-guy -c badddd -k aa601f -d 100 -i

alt text

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kleur-1.3.2.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kleur-1.3.2-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file kleur-1.3.2.tar.gz.

File metadata

  • Download URL: kleur-1.3.2.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kleur-1.3.2.tar.gz
Algorithm Hash digest
SHA256 162041337c7cc2c6b083ccb0edd301182987c6d76a1a80f767c0c14df2a9c3f7
MD5 30d616396df697c454cd2626b8c7bc83
BLAKE2b-256 453ebe2f6f090741ce7c69bd4fab3b0dda6ff3e23551a4e913a42902c2e7303b

See more details on using hashes here.

Provenance

The following attestation bundles were made for kleur-1.3.2.tar.gz:

Publisher: on-release-tag__publish-to-pypi.yml on githuib/kleur

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kleur-1.3.2-py3-none-any.whl.

File metadata

  • Download URL: kleur-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kleur-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d2372106729da06f1a83d7234339187d8e66ba6859a1cbd4d08dbed8a5612bf8
MD5 a60c14bab051620b75747c435ec6deae
BLAKE2b-256 5069c30d2f801622a0cda9aa5ee6b19a5b2586baff920bb92b17d054c544b1ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for kleur-1.3.2-py3-none-any.whl:

Publisher: on-release-tag__publish-to-pypi.yml on githuib/kleur

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page