wcag-contrast-ratio
A library for computing contrast ratios, as required by WCAG 2.0.
Usage
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)
21.0
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)
True
>> contrast.passes_AAA(21.0)
True
Metadata
Release files for wcag-contrast-ratio 0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| wcag-contrast-ratio-0.9.tar.gz | 2.1 kB | Without provenance | Details |
Release files / wcag-contrast-ratio-0.9.tar.gz
| Download URL | wcag-contrast-ratio-0.9.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69192b8e5c0a7d0dc5ff1187eeb3e398141633a4bde51c69c87f58fe87ed361c
|
|
BLAKE2b-256 checksum How to use checksums |
1fecfaf3e7ee407a00081372632cdd9858302c8a9bb071e3767f8dac2ac3f9e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for wcag-contrast-ratio 0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.