Colorgram is used to extract the colors from an image that is passed through the website. The website starts with a default image, and that image's colors are returned for the visitor.
Os and dotenv are used to load the environment variables from the .env file.
Flask and flask bootstrap are used to load the Flask web app.
Flask forms is used by the forms.py file to create the color pallet configuration form. The form contains two fields: an upload field and a dropdown that allows the user to select the number of colors to return. This form and output can be found in the screenshots folder and the Project Screenshots section.
The static folder contains the site assets used on this website. This includes the default color palette image that is loaded when the web app is launched or when the upload field is left blank.
The templates folder contains a single HTML page. This page displays the image uploaded as well as a form that allows users to upload an image and select how many colors they would like returned.
Forms.py is used to create the SettingsForm class in its own file. This class is then imported into main.py to render the form in the Flask web app.
Main.py does all the heavy lifting in this project. The settings form is imported to this file and the flask app is rendered here as well. The file also contains two functions that create an RGB tuple and return the colors in an image using Colorgram.
The program first starts by loading the home page with the default image used for the color palette results. The default results return 10 colors.
Using the page_info and color_tuple functions, the top colors that are pulled from the image are returned on the app's index page.
The bottom half of the page contains a Color Palette configuration form that allows the visitor to upload their own image and select the number of colors to be returned. When the visitor clicks Run, the page is reloaded with the new color palette output on the page.
This process can be repeated as long as the web app is running and allows users to generate their own color palettes!


