Metadata-Version: 2.4
Name: colourtools
Version: 0.1.4
Summary: colourtools is a lightweight Python library for intuitive conversion and manipulation of colours across multiple formats
License-File: LICENSE
Author: Albert Pang
Author-email: alpaaccount@mac.com
Requires-Python: >=3.12
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Description-Content-Type: text/markdown

### colourtools

**colourtools** is a lightweight Python library for intuitive conversion and manipulation of colours across multiple formats.


#### Features

- Convert between **CMYK**, **RGB**, and **HEX** colour spaces
- Support for both integer and floating-point representations
- Simple, readable API for common colour transformations
- Utility functions for encoding and decoding colour values
- Designed for clarity, reliability, and easy integration into your projects


#### Example Usage

```python
from colourtools import cmyk_to_rgb, rgb_to_cmyk, hex_to_rgb, rgb_to_hex

rgb  = cmyk_to_rgb((0, 100, 100, 0))   # (255, 0, 0)
cmyk = rgb_to_cmyk((255, 0, 0))         # (0, 100, 100, 0)
rgb  = hex_to_rgb("#FF0000")            # (255, 0, 0)
hex_ = rgb_to_hex((255, 0, 0))          # '#ff0000'
```

#### Full API

| Function | Input | Output |
|---|---|---|
| `cmyk_to_rgb(cmyk)` | CMYK (0–100) | RGB (0–255) |
| `cmyk_to_float_rgb(cmyk)` | CMYK (0–100) | float RGB (0.0–1.0) |
| `cmyk_to_hex(cmyk)` | CMYK (0–100) | hex string |
| `rgb_to_cmyk(rgb, decimal_places=0)` | RGB (0–255) | CMYK (0–100) |
| `rgb_to_float_rgb(rgb)` | RGB (0–255) | float RGB (0.0–1.0) |
| `rgb_to_hex(rgb)` | RGB (0–255) | hex string |
| `rgb_to_rgbk(rgb, k=1.0)` | RGB (0–255) | (R, G, B, K) |
| `hex_to_rgb(hex_color)` | hex string | RGB (0–255) |
| `hex_to_float_rgb(hex_color)` | hex string | float RGB (0.0–1.0) |
| `hex_to_cmyk(hex_color, decimal_places=0)` | hex string | CMYK (0–100) |
| `float_rgbk(rgbk)` | (R, G, B int, K float) | float (R, G, B, K) |

CMYK values are always in the range **0–100** (not 0–1). Hex strings are accepted with or without a leading `#`.


#### Installation

```bash
pip install colourtools
```


#### License

MIT License

*colourtools* makes colour conversion in Python simple, consistent, and accessible for everyone—no matter how you spell it.

