Metadata-Version: 2.4
Name: colorgen
Version: 1.1.0
Summary: Generate terminal colorschemes from images
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Keywords: colorscheme,theme,terminal,awesomewm,kitty,rofi,waybar,dunst
Author: Piotr Krzysztof
Author-email: piotr@codextechnologies.org
Requires-Python: ==3.12.*
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: POSIX :: Linux
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: Desktop Environment :: Window Managers
Requires-Dist: pillow (<12.1.0)
Requires-Dist: pylette (==5.1.1)
Description-Content-Type: text/markdown

# colorgen

<div align="center">

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

**Repo:** [Codeberg](https://codeberg.org/piotrkrzysztof/colorgen) (primary) · [GitHub](https://github.com/straightchlorine/colorgen) (mirror)

[![PyPI version](https://badge.fury.io/py/colorgen.svg)](https://pypi.org/project/colorgen/)
[![Total Downloads](https://static.pepy.tech/badge/colorgen)](https://pepy.tech/project/colorgen)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/colorgen)](https://pypi.org/project/colorgen/)
[![CI](https://ci.codextechnologies.org/api/badges/4/status.svg)](https://ci.codextechnologies.org/repos/4)

[Documentation](https://docs.colorgen.piotrkrzysztof.dev) · [PyPI](https://pypi.org/project/colorgen/)

</div>

![Dark theme example](https://colorgen.docs.codextechnologies.org/mkdocs/theme-dark-2.png)

## Install

```bash
pip install colorgen
```

Or from source:

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

Requires Python 3.12+.

## Usage

```bash
# 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 ([awesomewm-basileia](https://github.com/straightchlorine/awesomewm-basileia) layout)
- **Waybar** - status bar colors via `@define-color` CSS variables
- **dunst** - notification daemon colors via `dunstrc.d` drop-in
- **rofi** - launcher theme ([adi1090x/rofi](https://github.com/adi1090x/rofi) layout)

## Development

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

## License

GPL-3.0-or-later. Built with [Pylette](https://github.com/qTipTip/Pylette).

