Skip to content

Commit

Permalink
Prep for v0.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
MinchinWeb committed Dec 12, 2014
1 parent 9880804 commit f75916d
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 16 deletions.
5 changes: 4 additions & 1 deletion Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Changelog

## 0.1.0
## 0.1.0 -- December 11, 2014

- first working version
- includes base `colour` class, and (relative) `luminance` and `contrast` functions
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Colourettu

This is a small collection of colour functions in Python, that can be used
to determine the (relative) lumansity of a colour and the contrast
between two colours.

## Installation

~~~
pip install colourettu
~~~

## Note on Spelling

I have used the Canadian/British spelling of *colour* through this
Expand Down Expand Up @@ -106,6 +116,17 @@ contrast. This would be equivalent to 20/80 vision. Generally, it is assumed
that those with vision beyond this would access the web with the use of
assistive technologies.

If needed, these constants are stored in the library.

~~~python
>>> colourettu.A_contrast
3.0
>>> colourettu.AA_contrast
4.5
>>> colourettu.AAA_contrast
7.0
~~~

Also mentioned (and confirmed by personal experience), if the contrast is *too*
great, this can also cause readability problems when reading longer passages,
but I have been unable to find any quantitative research to this effect.
but I have been (yet) unable to find any quantitative research to this effect.
4 changes: 4 additions & 0 deletions colourettu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
from ._colour import _luminance as luminance
from ._colour import _contrast as contrast

from ._colour import _A_contrast as A_contrast
from ._colour import _AA_contrast as AA_contrast
from ._colour import _AAA_contrast as AAA_contrast

color = colour


Expand Down
4 changes: 4 additions & 0 deletions colourettu/_colour.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,7 @@ def _contrast(colour1, colour2):
maxlum = max(lum1, lum2)

return (maxlum + 0.05) / (minlum + 0.05)

_A_contrast = 3.0
_AA_contrast = 4.5
_AAA_contrast = 7.0
9 changes: 1 addition & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
Jinja2==2.7.3
MarkupSafe==0.23
Pygments==2.0.1
Sphinx==1.2.3
colorama==0.3.2
docutils==0.12
green==1.7.1
python-termstyle==0.1.10

7 changes: 1 addition & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def find_version(*file_paths):
raise RuntimeError("Unable to find version string.")


long_description = read('README.md', 'CHANGES.md')
long_description = read('README.md') + '\n' + read('Changes.md')


setup(
Expand All @@ -29,7 +29,6 @@ def find_version(*file_paths):
url='http://github.com/minchinweb/colourettu',
license='MIT License',
author='William Minchin',
tests_require=['green'],
install_requires=['',
],
author_email='w_minchin@hotmail.com',
Expand All @@ -38,7 +37,6 @@ def find_version(*file_paths):
packages=['colourettu'],
include_package_data=True,
platforms='any',
# test_suite='sandman.test.test_sandman',
classifiers=[
'Programming Language :: Python',
'Development Status :: 2 - Pre-Alpha',
Expand All @@ -50,7 +48,4 @@ def find_version(*file_paths):
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Multimedia :: Graphics',
],
# extras_require={
# 'testing': ['pytest'],
# }
)

0 comments on commit f75916d

Please sign in to comment.