PaintCan
PaintCan is a high-quality, Pythonic library for working with HSBA colors and generating beautiful, algorithmic color schemes. It provides robust tools for color manipulation and harmony generation.
Features
- HSBAColor: A value-type representation of color using Hue, Saturation, Brightness, and Alpha (0.0 - 1.0).
- Validates all components on construction.
- Cyclic Hue adjustment (wrapping).
- Clamping and full-interval Overflow support for Saturation and Brightness.
- Pythonic unpacking:
h, s, b, a = color.
- ColorScheme: A collection of colors generated by color theory rules.
- Immutable and supports the Sequence protocol (
len(scheme),scheme[0], slicing, iteration). - 8 factory methods for generating harmonious schemes:
- Analogous
- Accented Analogous
- Complementary
- Compound
- Monochromatic
- Shades
- Split Complementary
- Triadic
- Immutable and supports the Sequence protocol (
Installation
Using PDM:
pdm add paintcan
Using pip:
pip install paintcan
Usage
Working with HSBAColor
from paintcan import HSBAColor
# Create a color (Red)
red = HSBAColor(hue=0.0, saturation=1.0, brightness=1.0, alpha=1.0)
# Adjust Hue (wraps around)
orange = red.adjust_hue(0.08)
# Get the complement (Cyan-ish)
cyan = red.complement()
# Pythonic Unpacking
h, s, b, a = cyan
print(f"Hue: {h}, Saturation: {s}")
Generating Color Schemes
from paintcan import HSBAColor, ColorScheme
# Start with a base color
base = HSBAColor(0.5, 0.8, 0.9, 1.0) # Cyan-ish
# Generate a Split Complementary scheme
scheme = ColorScheme.from_split_complementary(base)
# Access colors (behaves like a tuple)
print(f"Scheme has {len(scheme)} colors.")
theme = scheme.theme_color # First color is always the theme color
for color in scheme:
print(color)
Demo
To see the color schemes in action in your terminal (using ANSI colors):
# If installed via PDM/Dev
pdm run python -m paintcan
# If installed in your environment
python -m paintcan
Development
The maintainer and agent docs live in docs/index.md. For local validation:
pdm install --group dev
pdm run check
pdm build
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for paintcan 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| paintcan-0.1.4.tar.gz | 7.7 kB | With provenance | Details for paintcan-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| paintcan-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for paintcan-0.1.4-py3-none-any.whl |
Total release size: 15.8 kB
Release files / paintcan-0.1.4.tar.gz
| Download URL | paintcan-0.1.4.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d1266676822e5006a6296ce1b6bf0d89076cbe9d4f85cae204fab5b00147155b
|
|
BLAKE2b-256 checksum How to use checksums |
f8bcfc620ea97e1aa5400f8a945677f7bc040323f3cefec8028a62067284fc7f
|
| 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 May 8, 2026.
Transparency logRelease files / paintcan-0.1.4-py3-none-any.whl
| Download URL | paintcan-0.1.4-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1008c9bceb04cd9d6920f8d034dee4cf9753ad8edba29bbe4e9f00b23b0997e1
|
|
BLAKE2b-256 checksum How to use checksums |
d2d524426bd26bcbb9d73ff08d515c40cfff6694bafdb3ed7f5dfa5847616746
|
| 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 May 8, 2026.
Transparency logSecurity for paintcan 0.1.4
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.
Attestation for paintcan-0.1.4.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 May 8, 2026.
Transparency logA 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.