- Introduction
- Live Demo
- Features
- Motivation
- Technologies Used
- Getting Started
- Usage
- Contributing
- License
- Contact
Color Theme Generator is a React-based web application that helps users create beautiful color schemes for their projects. By selecting a primary color, the app generates multiple color palettes with complementary colors, ensuring accessibility and visual appeal.
Check out the live demo of the Color Theme Generator: Live Demo
- Interactive color picker for selecting the primary color
- Generation of multiple color schemes based on the primary color
- Real-time preview of color schemes
- Accessibility checks for color contrast (AA and AAA compliance)
- Copy-to-clipboard functionality for easy color code sharing
- Responsive design for various screen sizes
The motivation behind this project stems from the complexity of choosing colors when building websites. As developers and designers, we often struggle to create cohesive and accessible color schemes that enhance the user experience. The Color Theme Generator aims to simplify this process by providing instant, harmonious color palettes based on a single primary color choice.
- React
- CSS3
- JavaScript (ES6+)
- react-colorful (for color picker)
- FontAwesome (for icons)
- color-contrast-checker (for accessibility checks)
To get a local copy up and running, follow these simple steps:
- Clone the repository
git clone https://github.com/swe-robertkibet/react-color-theme-generator.git
- Navigate to the project directory
cd color-theme-generator
- Install NPM packages
npm install
- Start the development server
npm start
- Open the application in your web browser
- Use the color picker or input a hex color code to select your primary color
- The app will generate multiple color schemes based on your selection
- Preview the color schemes in the provided illustration
- Copy color codes by clicking the copy icon next to each color
- Use the generated color schemes in your own projects
Our Color Theme Generator uses a sophisticated algorithm to create harmonious and visually appealing color palettes. Here's an overview of how it works:
-
Base Color Selection:
- The algorithm starts with a user-selected or randomly generated base color.
- This color is converted to HSL (Hue, Saturation, Lightness) format for easier manipulation.
-
Harmony Rules:
- We implement various color harmony rules, including:
- Complementary: Colors opposite on the color wheel
- Analogous: Colors adjacent on the color wheel
- Triadic: Three colors evenly spaced on the color wheel
- Split-complementary: A base color and two colors adjacent to its complement
- We implement various color harmony rules, including:
-
Saturation and Lightness Adjustment:
- The algorithm adjusts saturation and lightness values to ensure good contrast and readability.
- It uses a weighted random approach to create slight variations while maintaining harmony.
-
Accessibility Considerations:
- We implement checks to ensure sufficient contrast ratios for text readability, adhering to WCAG guidelines.
-
Theme Generation:
- Based on the selected harmony rule, the algorithm generates a full theme, including:
- Primary and secondary colors
- Background colors
- Text colors
- Accent colors
- Based on the selected harmony rule, the algorithm generates a full theme, including:
-
Fine-tuning:
- A final pass adjusts colors to ensure they work well together and meet specific criteria (e.g., minimum contrast ratios).
We welcome contributions to enhance our color generation algorithm. Here are some areas where we'd love to see improvements:
- Implementing additional color harmony rules
- Enhancing the algorithm's ability to generate accessible color combinations
- Optimizing the performance of color calculations
- Adding support for different color models (e.g., CMYK for print-focused palettes)
- Developing machine learning approaches to generate color schemes based on user preferences or trends
If you're interested in contributing to these areas or have ideas for other improvements, please check the information below or contact me directly on WhatsApp
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
We are particularly interested in contributions that enhance the color palette generation algorithm. If you have ideas on how to improve the variety or quality of generated color schemes, please consider contributing!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Click the button above to start a chat with us on WhatsApp.