Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

randomcolor

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

randomcolor

For generating attractive random colors

  • 0.4.4.6
  • PyPI
  • Socket score

Maintainers
1

randomcolor Build Status

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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc