Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install namethatcolor

How to install NameThatColor

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install namethatcolor
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0.3 Available View build log
1.0.2 Available View build log
1.0.1 Available View build log
Windows (64-bit)
1.0.3 Available View build log
1.0.2 Available View build log
1.0.1 Available View build log
Mac OS X (10.5+)
1.0.3 Available View build log
1.0.2 Available View build log
1.0.1 Available View build log
Linux (32-bit)
1.0.3 Available View build log
1.0.2 Available View build log
1.0.1 Available View build log
Linux (64-bit)
1.0.3 Available View build log
1.0.2 Available View build log
1.0.1 Available View build log
 
License
LICENSE.txt
Dependencies
Imports
Lastest release
version 1.0.3 on Jan 5th, 2011

Provides a utility for retrieving the closest known "human readable" name for a color specified as a hex string. It does this by using an algorithm ported from ntc.js ( http://chir.ag/projects/ntc ).

There are 3 different sets of color definitions to choose from:
Resene ( http://people.csail.mit.edu/jaffer/Color/resenecolours.txt ) html4 ( http://www.w3.org/TR/css3-color/#html4 ) css3 ( http://www.w3.org/TR/css3-color/#svg-color )

css3 is a superset of html4.

The user can also supply their own colorfile to use. It should be comma separated hex,name pairs, and should include the leading #. Commas are allowed in names.

Currently two output formats are supported -- json, and raw.

Usage:

As a command-line utility:

$ namethatcolor aabbcc {"hex_value": "#B0C4DE", "name": "lightsteelblue"} $ namethatcolor --color-set resene aabbcc {"hex_value": "#ADBED1", "name": "Casper"}

#same as above $ namethatcolor -s resene aabbcc

#specify your own color file $ namethatcolor -c path/to/color/file aabbcc

As a library:

>>> from namethatcolor import NameThatColor
>>> Namer = NameThatColor()
>>> Namer.name('aabbcc')
Match('#B0C4DE', 'lightsteelblue', False, '#AABBCC')
>>> resene_filename = NameThatColor.color_sets['resene']
>>> resene_colors = NameThatColor.get_color_file(resene_filename)
>>> Namer = NameThatColor(color_file=resene_colors)
>>> Namer.name('aabbcc')
Match('#ADBED1', 'Casper', False, '#AABBCC')

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:4

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.