For generating attractive random colors
Project description
randomcolor ![Build Status](https://pypi-camo.freetls.fastly.net/65086b1fdcaf5a437666c1aa8795dbc73b7b1538/68747470733a2f2f7472617669732d63692e6f72672f6b6576696e7775686f6f2f72616e646f6d636f6c6f722d70792e7376673f6272616e63683d6d6173746572)
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
Hashes for randomcolor-0.4.4.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f1a81d39cacae560c499fda390913a6bf47d6c0c1cd61f625a2a87a16dfff45 |
|
MD5 | 662c4e34a16d18f114f4d0e35e2f12de |
|
BLAKE2b-256 | c964b246ee088465046ae2111c8eb3373062014b77ce6ab9af9c70bf976af980 |