This project provides a user-friendly interface for generating random color palettes using the Colormind API. Users can select from predefined models to create unique palettes, which are saved to a local SQLite database for future use. The project is built using Streamlit for the frontend and Python for backend operations.
- Model Selection: Choose from predefined models like
default,ui, andmetroid_fusionto generate palettes. - Random Palette Generation: Generates five random colors using the selected model.
- Database Integration: Saves generated palettes to an SQLite database for persistence.
- Visual Display: Displays generated palettes in a visually appealing way with RGB color codes.
Before running the application, ensure the following dependencies are installed:
- Python 3.7 or later
- Required Python libraries:
streamlitrequestssqlite3(built-in with Python)
Install the required libraries using pip:
pip install streamlit requests-
Start the Streamlit application:
streamlit run main.py
-
Open the application in your browser using the provided URL (usually
http://localhost:8501).
color-palette-generator/
├── main.py # Main Streamlit application
├── random_palette.py # Module for generating and saving palettes
├── palettes.db # SQLite database (auto-created)
└── README.md # Project documentation
- Launch the application in your browser.
- Click on a model button (e.g.,
Generate Default) to create a palette. - View the generated palette, including RGB codes, displayed visually.
- Palettes are automatically saved to the
palettes.dbSQLite database.
Below is an example of a generated palette:
| Color | RGB Code |
|---|---|
| (255, 87, 51) | |
| (51, 255, 87) | |
| (51, 87, 255) | |
| (255, 255, 51) | |
| (51, 255, 255) |
-
API Errors: Ensure you have an active internet connection. If the API response is empty, verify the model name.
-
Database Issues: If there are problems with the database, delete the
palettes.dbfile to reset it.
Contributions are welcome! If you'd like to add features or fix bugs, feel free to fork the repository and submit a pull request.
- Colormind API for providing random color palette generation.