SiteAnalyzer is a Python tool that helps you analyze the color contrast and speed of websites, taking into account both light and dark themes. The tool follows the Web Content Accessibility Guidelines (WCAG) 2.1 AA level requirements for color contrast and suggests alternative colors when the contrast ratio is not met. It also checks for large text contrast ratios and provides color suggestions for dark themes when needed. Additionally, SiteAnalyzer measures the First Contentful Paint (FCP) and site speed using the Playwright library.
- Analyzes color contrast of websites based on WCAG 2.1 AA level requirements
- Supports light and dark themes (including the
prefers-color-scheme
CSS media feature) - Suggests alternative colors for improved contrast
- Handles rgba and transparent color values
- Checks for large text contrast ratios
- Provides color suggestions for dark themes
- Measures First Contentful Paint (FCP) and site speed
- Install the required Python libraries using the following command:
pip install requests beautifulsoup4 cssutils pillow colour playwright
- Install Playwright browsers using the following command:
playwright install
-
Download the SiteAnalyzer Python script from this repository.
-
CD into the js folder and run the following command:
npm install
- Run the SiteAnalyzer script using the following command:
python speed_analyzer.py
- When prompted, enter the URL of the website you want to analyze. The script will then analyze the site's FCP and site speed, providing suggestions if necessary.
- Run the ColorAnalyzer script using the following command:
python color_analyzer.py
- When prompted, enter the URL of the website you want to analyze. The script will then analyze the site's color contrast, providing suggestions if necessary.
- Install the required Python libraries using the following command:
pip install fastapi uvicorn
- Run the API using the following command:
uvicorn api:app --reload
- Install the required npm libraries using the following command:
npm install
- Run the client app using the following command:
npm start
SiteAnalyzer is released under the MIT License.
Contributions are welcome! Please feel free to submit a pull request or open an issue for bug reports or feature requests.
If you encounter any issues or have questions, please open an issue on this repository.