Skip to main content

Finds the name of any color.

Project description

python-colornames

A Python library for finding the names of colors.

The colornames library gives you the name of any RGB color. If the exact color you're looking for doesn't have a name, it'll find the closest match instead.

Usage

A single function, find, is exposed by the library. It finds the name of a given color.

>>> import colornames
>>> colornames.find(255, 255, 255)   # Decimal RGB
'White'
>>> colornames.find('#3e3e3e')       # Hexadecimal notation
'Dune'
>>> colornames.find('#abc')          # Shorthand hexadecimal
'Cadet Blue'
>>> colornames.find('f5f5f5')        # Optional '#' prefix
'Wild Sand'
>>> colornames.find((123, 12, 1))    # Decimal RGB as a tuple
'Dark Burgundy'

License

The code is licensed under the MIT license. Certain parts are licensed under CC BY 2.5 (see acknowledgements).

Acknowledgements

The list of color names is based on Chirag Mehta's ntc js, licensed under CC BY 2.5.

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

pycolornames-1.1.0.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycolornames-1.1.0-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file pycolornames-1.1.0.tar.gz.

File metadata

  • Download URL: pycolornames-1.1.0.tar.gz
  • Upload date:
  • Size: 58.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pycolornames-1.1.0.tar.gz
Algorithm Hash digest
SHA256 902c612f46684a5e619c52cc4cb6aec920f6f3d4d093ffb5206702d69a9b9697
MD5 ab44aa8aa5128b8fdcc825439f007369
BLAKE2b-256 0bb3ffa5cb19d77568751a14c4c13802d0d14918fc47f158f0bab1bda5d41181

See more details on using hashes here.

File details

Details for the file pycolornames-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pycolornames-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pycolornames-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38451739be1c49a909a227d7155504cb53a812267d5dc875b341c297f70878af
MD5 13b307d3614211b87203c924aba04899
BLAKE2b-256 cd9e0a9fde7ed68c459a434e79c10d120248afd5ce7248c809979d050136d9e1

See more details on using hashes here.

Supported by

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