🚀 Advice welcome!
This Chrome extension allows users to select two colors using an eyedropper tool or manual input, and then calculates the contrast ratio between the colors, offering helpful WCAG information as a result. The goal of this tool is to help designers and developers meet WCAG accessibility standards for color contrast.
- To run the extension locally:
- Clone this repository:
git clone https://github.com/robertcdawson/color-contrast-checker.git - Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right corner
- Click "Load unpacked" and select the cloned project directory
- Clone this repository:
- Click the extension icon in your Chrome browser to open the color picker.
- Use the eyedropper tool to select colors from your current web page:
- Click the first color square to pick the foreground color.
- Click the second color square to pick the background color.
- The contrast ratio will be calculated and displayed automatically.
- For manual input, use the hex color input fields below each color square.
- The extension will indicate whether the selected colors meet WCAG accessibility standards.
- Eyedropper tool for easy color selection (with fallback for unsupported browsers)
- Manual hex color input
- Real-time contrast ratio calculation
- WCAG compliance indicator
To set up the project for development:
- Clone the repository
- Open the project folder in your preferred code editor
- Ensure you have Node.js installed on your system
- Open a terminal and navigate to the project directory
- Install the project dependencies by running:
npm install - Build the project using:
This will use webpack to bundle the project according to the configuration in
npm run buildwebpack.config.js
To run tests:
- After setting up the project (steps 1-5 above), run the tests using:
npm test
This will execute all test files in the src/__tests__ directory using Jest.
For more information about Chrome Extensions and the EyeDropper API, refer to these helpful resources:
These resources provide comprehensive information about developing Chrome extensions and using the EyeDropper API, which are key components of this project.