Skip to main content

A Python library for working and managing colors

Project description

ColorSpaceLib

ColorSpaceLib is a python color library designed to make working with color much easier and Intresting with python.

Installation

pip install colorspacelib

Usage

>>> from colorspacelib.colorspace import Color
>>> mygreen = Color('#7CFC00')
>>> mygreen.shade()
'green'
>>> myorange = Color('255,179,71')
>>> myorange.shade()
'orange or brown'
>>> myred = Color('D73B3E')
>>> myred.shade()
'red'

The Colorspacelib package comes with some predifined colors which can be imported and used in your script.

>>> import colorspacelib as csl
>>> print(csl.black)
#000000
>>> print(csl.green)
#00ff00
>>> print(csl.blue.toRgb())
(0, 0, 255)

Color Instances also supports mixing of two color using The additive color mixing.

>>> import colorspacelib as csl
>>> new_col = csl.green + csl.yellow
>>> print(new_col)
127,191,0
>>> new_col.shade()
'yellow-green'

There is also a converter module inside the colorspacelib that contains function for convertion of a color format to another. The functions are listed as follows :

  • Hexrgb
  • rgbHex
  • rgbHsv
  • hsvRgb
  • rgbHsl
  • hslRgb
  • rgbCmyk
  • cmykRgb

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

This Project is under The MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

colorspacelib-0.9.8.tar.gz (2.0 kB view details)

Uploaded Source

File details

Details for the file colorspacelib-0.9.8.tar.gz.

File metadata

  • Download URL: colorspacelib-0.9.8.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.3

File hashes

Hashes for colorspacelib-0.9.8.tar.gz
Algorithm Hash digest
SHA256 b54c5b871e2909af35fde6d15a3324124b8de373408bdf7d0004e5a2f0092bc4
MD5 d83772596e765e02936fb2edcf61c73f
BLAKE2b-256 cba3498c36bf00ac7e03a3d6a0891b7b6bbb4edc204dd26bdb68afbee46c1b51

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page