color-generator
generate random good-looking colors
Installation
pip install color-generation
usage example
from color_generator import Color, generate
# simple color-generation
color = generate()
print(color) # <Color (139,242,38)>
# specific color-generation
color = generate("colorless")
print(color) # <Color (1,70,24)>
# and various formats depending on your need
print(color.rgb) # (1, 70, 24)
print(color.hex) # '#014618'
print(color.hls) # (0.3888888888888889, 35.5, -1.0)
print(color.hsv) # (0.3888888888888889, 0.9857142857142858, 70)
print(color.yiq) # (44.239999999999995, -26.532799999999995, -29.053599999999996)
# and you can also transform between formats
Color.from_hex('#014618').rgb # (1, 70, 24)
generation modes
passed as string to generate(mode)
basic
- can contain the full variety of colors
no-mono
- attempts to avoid colors like black and white
colorful
- generates brighter colors
colorless
- generates darker colors
Metadata
Release files for color-generation 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| color-generation-0.3.0.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| color_generation-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.8 kB
Release files / color-generation-0.3.0.tar.gz
| Download URL | color-generation-0.3.0.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1135717e8e804cbb23123dd096a6864e7e8c89dddb1c8bef961bb9ecf787b121
|
|
BLAKE2b-256 checksum How to use checksums |
ba69f8b6fd5a6b2a5bf0aab1c5b8410ed61947e9a036d69518c837a89edc2649
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.12
|
Release files / color_generation-0.3.0-py3-none-any.whl
| Download URL | color_generation-0.3.0-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53af32330e3f1cbd150841135d3ee88d2aff0dbd7ea31c6dff0b001865ed58a2
|
|
BLAKE2b-256 checksum How to use checksums |
ace07df7e35696cc565978c3f2abe4b9397acfe57d7d5f6cd2d41e2c9d759df2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.12
|