Skip to main content

Generate terminal colorschemes from images

Project description

colorgen

Generate terminal colorschemes from images for kitty, AwesomeWM, and rofi.

Repo: Codeberg (primary) | GitHub (mirror)

CI PyPI version Total Downloads PyPI - Downloads

Documentation | PyPI

Dark theme example

Install

pip install colorgen

Or from source:

git clone https://codeberg.org/piotrkrzysztof/colorgen.git
cd colorgen
make install

Requires Python 3.12+.

Usage

# Preview colors from an image
colorgen wallpaper.png --preview

# Generate and apply a kitty colorscheme
colorgen wallpaper.png --config kitty --theme dark --apply

# Multiple targets
colorgen wallpaper.png --config kitty awesome rofi --apply

# All targets
colorgen wallpaper.png --full-config --theme dark --apply

When applying, the old theme gets commented out, not deleted.

How it works

Extracts 10 dominant colors from the image via K-means clustering, then maps them to a 19-color terminal palette (bg, fg, cursor, colors 0-15) based on hue diversity and luminance.

Supported targets

  • kitty - terminal color config
  • AwesomeWM - window manager theme
  • rofi - launcher theme (adi1090x/rofi layout)

Development

make install   # install deps
make test      # run tests
make lint      # check code style

License

GPL-3.0-or-later

Author

Piotr Krzysztof Lis - Codeberg | GitHub

Built with Pylette for color extraction.

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

colorgen-1.0.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

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

colorgen-1.0.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file colorgen-1.0.0.tar.gz.

File metadata

  • Download URL: colorgen-1.0.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for colorgen-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a38adea523d32e7d119048a5743eb55807f924d1fb0bcf81f6b5a02b91a6500e
MD5 908ceef27f4f6d6c2fcf91e2d80de21f
BLAKE2b-256 b6978f4eb9a5197a41b3f780c88572ac6a546f1bb8e48535491e5f1ce042d332

See more details on using hashes here.

File details

Details for the file colorgen-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: colorgen-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for colorgen-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d74fe4e65c10c197f9c2e87834b0420044e9488c89d141aa2531bd294efb0a53
MD5 fb579318265d68d6d6fedb959d887b06
BLAKE2b-256 2cac7c184f442cff956b99cdeafa66d8e29ba3fc31210f68909d5e0e67e66b62

See more details on using hashes here.

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