For generating attractive random colors
Project description
randomcolor
A port of David Merfield's randomColor (currently davidmerfield/randomColor@0.4.4) to python. Tested against python versions 3.6, 3.7, 3.8, 3.9, pypy, and pypy3.
Usage
Generating a completely random color:
import randomcolor
rand_color = randomcolor.RandomColor()
print(rand_color.generate())
Generating 3 random blue colors:
print(rand_color.generate(hue="blue", count=3))
Refer to the tests for examples and README at davidmerfield/randomColor for full usage details.
Tests
Run python setup.py test
to run the test suite with stored expected colors
generated from a seeded randomcolor object.
Run python tests/test_randomcolor_visual.py
to generate an html page with random
colors generated from using this package. Open randomcolors.html
to confirm
that the colors fall within the parameters pased in. This is in addition to unit
tests since it's much easier to visually confirm that the colors generated
are correct than determine correctness programatically.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file randomcolor-0.4.4.6.tar.gz
.
File metadata
- Download URL: randomcolor-0.4.4.6.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2b66f07ea8606aee55b648aed82e810964bbd3f6dfba0e6d57818761d437c93 |
|
MD5 | c5306d32068e25fe487cbd6dedb67403 |
|
BLAKE2b-256 | 50961f3bfafcb0e7bd7fbc122fa1fd4af7fc6b59543ceaf98786cc14a070db25 |
File details
Details for the file randomcolor-0.4.4.6-py3-none-any.whl
.
File metadata
- Download URL: randomcolor-0.4.4.6-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f1a81d39cacae560c499fda390913a6bf47d6c0c1cd61f625a2a87a16dfff45 |
|
MD5 | 662c4e34a16d18f114f4d0e35e2f12de |
|
BLAKE2b-256 | c964b246ee088465046ae2111c8eb3373062014b77ce6ab9af9c70bf976af980 |