The Color Palette Generator is a web application that allows users to enter descriptive phrases or titles, such as "misty morning on the lake in spring" or "Wes Anderson's 'The Life Aquatic'", and get a corresponding color palette generated. The palettes consist of between 2 and 8 colors, returned as hexadecimal color codes.
This app combines a frontend built with HTML, CSS, and JavaScript with a backend powered by Flask and OpenAI's GPT-3 API.
- User Prompts: Users can input descriptive text to get a corresponding color palette.
- Dynamic Palette Display: Generated palettes dynamically update on the page without a full reload.
- Copy to Clipboard: Users can click on a specific color to copy its hexadecimal value to their clipboard, with a confirmation tooltip.
- Clear Functionality: A clear button allows users to reset the palette and input field.
The backend, written in Python using Flask, communicates with OpenAI's GPT-3 API. It sends the user's descriptive text to the model and processes the returned color codes to be displayed on the frontend.
- Clone the repository.
- Navigate to the project directory.
- Install necessary dependencies. If using pip:
pip install -r requirements.txt - Ensure you have set up your
.envfile with your OpenAI API key:OPENAI_API_KEY=your_api_key_here - Run the Flask application:
python app.py - Visit the local server URL (typically
http://127.0.0.1:5000/) in your browser.
The frontend can be deployed to platforms like Netlify or Vercel. For the backend, consider using cloud platforms like DigitalOcean, Google Cloud Platform, AWS, Azure, or Render, especially if avoiding Heroku due to its sleeping dynos on the free tier.
- Introduce user accounts to save favorite palettes.
- Integrate more advanced color manipulation and visualization tools.
- Provide additional customization options for palette generation.