Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

A library for computing contrast ratios, as required by WCAG 2.0

Project description

A library for computing contrast ratios, as required by WCAG 2.0.


Simple usage follows this pattern:

>> import wcag_contrast_ratio as contrast
>> black = (0.0, 0.0, 0.0)
>> white = (1.0, 1.0, 1.0)
>> contrast.rgb(black, white)

Two useful helper functions are provided, to check if contrast meets the required level:

>> import wcag_contrast_ratio as contrast
>> contrast.passes_AA(21.0)
>> contrast.passes_AAA(21.0)

Project details

Release history Release notifications

This version
History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
wcag-contrast-ratio-0.9.tar.gz (2.1 kB) Copy SHA256 hash SHA256 Source None Jul 30, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page