roadsideseb / python-colourlovers Goto Github PK
View Code? Open in Web Editor NEWModule to use ColourLovers API
Home Page: http://python-colourlovers.readthedocs.org
License: GNU General Public License v3.0
Module to use ColourLovers API
Home Page: http://python-colourlovers.readthedocs.org
License: GNU General Public License v3.0
The README file only contains examples but is missing basic descriptions and a bit more advanced documentation.
[portnov]$ pip install python-colourlovers
Downloading/unpacking python-colourlovers
Downloading python-colourlovers-0.1.0.tar.gz
Running setup.py egg_info for package python-colourlovers
Traceback (most recent call last):
File "", line 16, in
File "/tmp/pip_build_portnov/python-colourlovers/setup.py", line 32, in
open('CHANGELOG.rst').read(),
IOError: [Errno 2] No such file or directory: 'CHANGELOG.rst'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 16, in
File "/tmp/pip_build_portnov/python-colourlovers/setup.py", line 32, in
open('CHANGELOG.rst').read(),
IOError: [Errno 2] No such file or directory: 'CHANGELOG.rst'
/usr/local/lib/python2.7/dist-packages/python_colourlovers-0.1.0-py2.7.egg/colourlovers/init.py:139: DeprecationWarning: This method will be removed in future versions. Use 'list(elem)' or iteration over elem instead.
if len(child.getchildren()) == 0:
Patterns, Palettes & Colours include an image and badge URL that points to a PNG file. The API should provide a convenience method to download these images to a location of choice.
In [294]: import colorlover as cl
In [295]: cl
Out[295]: <module 'colorlover' from '/home/latty/.virtualenvs/screenpulse-unittest/local/lib/python2.7/site-packages/colorlover/__init__.pyc'>
In [296]: colormaps = cl.scales['7']['qual']['Dark2']
In [297]: colormaps
Out[297]:
['rgb(27,158,119)',
'rgb(217,95,2)',
'rgb(117,112,179)',
'rgb(231,41,138)',
'rgb(102,166,30)',
'rgb(230,171,2)',
'rgb(166,118,29)']
In [298]: cl.interp(colormaps, 11)
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-298-946770f2b787> in <module>()
----> 1 cl.interp(colormaps, 11)
/home/latty/.virtualenvs/screenpulse-unittest/local/lib/python2.7/site-packages/colorlover/__init__.pyc in interp(scl, r)
1821 c_i = int(i*math.floor(SCL_FI)/round(r[-1])) # start color index
1822 hsl_o = rgb_to_hsl( scl[c_i] ) # convert rgb to hls
-> 1823 hsl_f = rgb_to_hsl( scl[c_i+1] )
1824 section_min = c_i*r[-1]/SCL_FI
1825 section_max = (c_i+1)*(r[-1]/SCL_FI)
IndexError: list index out of range
this bug is not stable, here for example:
In [310]: cl.interp(colormaps, 10)
Out[310]:
['hsl(162.0, 70.0%, 36.0%)',
'hsl(70.6666666667, 88.6666666667%, 40.0%)',
'hsl(72.3333333333, 75.3333333333%, 47.0%)',
'hsl(167.0, 30.0%, 57.0%)',
'hsl(275.0, 62.6666666667%, 54.3333333333%)',
'hsl(248.666666667, 75.6666666667%, 48.0%)',
'hsl(88.0, 69.0%, 38.0%)',
'hsl(58.6666666667, 88.3333333333%, 42.6666666667%)',
'hsl(29.3333333333, 107.666666667%, 47.3333333333%)',
'hsl(38.0, 70.0%, 38.0%)']
In [311]: cl.interp(colormaps, 11)
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-311-946770f2b787> in <module>()
----> 1 cl.interp(colormaps, 11)
/home/latty/.virtualenvs/screenpulse-unittest/local/lib/python2.7/site-packages/colorlover/__init__.pyc in interp(scl, r)
1821 c_i = int(i*math.floor(SCL_FI)/round(r[-1])) # start color index
1822 hsl_o = rgb_to_hsl( scl[c_i] ) # convert rgb to hls
-> 1823 hsl_f = rgb_to_hsl( scl[c_i+1] )
1824 section_min = c_i*r[-1]/SCL_FI
1825 section_max = (c_i+1)*(r[-1]/SCL_FI)
IndexError: list index out of range
In [312]: cl.interp(colormaps, 15)
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-312-e3b4fde92ac0> in <module>()
----> 1 cl.interp(colormaps, 15)
/home/latty/.virtualenvs/screenpulse-unittest/local/lib/python2.7/site-packages/colorlover/__init__.pyc in interp(scl, r)
1821 c_i = int(i*math.floor(SCL_FI)/round(r[-1])) # start color index
1822 hsl_o = rgb_to_hsl( scl[c_i] ) # convert rgb to hls
-> 1823 hsl_f = rgb_to_hsl( scl[c_i+1] )
1824 section_min = c_i*r[-1]/SCL_FI
1825 section_max = (c_i+1)*(r[-1]/SCL_FI)
IndexError: list index out of range
In [313]: cl.interp(colormaps, 16)
Out[313]:
['hsl(162.0, 70.0%, 36.0%)',
'hsl(107.2, 81.2%, 38.4%)',
'hsl(52.4, 92.4%, 40.8%)',
'hsl(-2.4, 103.6%, 43.2%)',
'hsl(110.2, 57.2%, 51.0%)',
'hsl(167.0, 30.0%, 57.0%)',
'hsl(223.8, 2.8%, 63.0%)',
'hsl(296.6, 69.2%, 53.8%)',
'hsl(361.4, 88.8%, 52.2%)',
'hsl(426.2, 108.4%, 50.6%)',
'hsl(88.0, 69.0%, 38.0%)',
'hsl(-8.4, 65.0%, 32.0%)',
'hsl(-104.8, 61.0%, 26.0%)',
'hsl(-201.2, 57.0%, 20.0%)',
'hsl(17.6, 115.4%, 49.2%)',
'hsl(0.0, 127.0%, 52.0%)']
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.