Skip to content

A color contrast tool designed for designers, developers and accessibility advocates.

License

Notifications You must be signed in to change notification settings

jabahm/Contrastify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎨 Contrastify

GitHub last commit License Python version

👁️‍🗨️ Why Good Contrast Matters

Contrastify is a tool built to facilitate color contrast checking, ensuring that designs are not only aesthetically pleasing but also accessible to all users (WCAG guidelines), including those with visual impairments.

📦 Installation

1.Clone the repository:

git clone https://github.com/Ahmed-Jabrane/Contrastify.git

2.Navigate to the cloned directory:

cd Contrastify

3.Install the package locally:

pip install -e .

🛠️ Usage

Compute Contrast Ratio

from contrastify import compute_contrast, check_wcag_norms
from contrastify.utils import hex_to_rgb

color1 = hex_to_rgb("#FFFFFF")  # White
color2 = hex_to_rgb("#000000")  # Black

contrast_ratio = compute_contrast(color1, color2)
print(f"Contrast Ratio: {contrast_ratio:.2f}")

Check Against WCAG Norms

wcag_results = check_wcag_norms(contrast_ratio)

for norm, meets_criteria in wcag_results.items():
    status = "meets" if meets_criteria else "does not meet"
    print(f"The contrast ratio {status} the {norm} criteria.")

🤝 Contributing

Guidelines for contributing to "Contrastify". Direct readers to CONTRIBUTING.md for detailed instructions.

📄 License

Contrastify is under the MIT License. See LICENSE file for more details.

📚 Further Reading

To understand more about the importance of color contrast and accessibility guidelines, refer to the following resources: The WCAG guidelines provide extensive recommendations for making web content more accessible. These guidelines are used globally and form the basis for many regional accessibility laws and policies. (Web Content Accessibility Guidelines (WCAG))

About

A color contrast tool designed for designers, developers and accessibility advocates.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages