Skip to content

Day 92 of the 100 Days of Code course. Goal for this course was to create a Flask app that displays the most common colors for a picture that is processed.

Notifications You must be signed in to change notification settings

briansalazar-tech/100DaysofCode-Color-Palette-Site

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

100 Days of Code Day 91: Collor Palette Site

Modules Used

Colorgram

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 & Dotenv

Os and dotenv are used to load the environment variables from the .env file.

Flask & Flask Bootstrap

Flask and flask bootstrap are used to load the Flask web app.

Flask Forms

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.

Project Files

Static Folder

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.

Templates Folder

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

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

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.

Project Walkthrough

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!

Project Flowchart

Color palett website flowchart

Project Screenshots

Uploaded picture

Color outputs, upload and settings configuration form

About

Day 92 of the 100 Days of Code course. Goal for this course was to create a Flask app that displays the most common colors for a picture that is processed.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published