Skip to content

clothing-color-coordinator/API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text

the color wheel api

the api for all of your color palette needs!

alt text

table of contents

purpose:

This API exists to hopefully make live a little simpler for anyone that works with color. Send a color to one of our many endpoints and receive a color palette back, complete with the color name and hex codes.

summary

The Color Wheel API provides color palettes based on user input and the color wheel. Each endpoint takes a color name and returns a JSON object for their specific color scheme: - GetAnalogousPalette: Returns an analogous palette. - GetComplementaryPalette: Returns a complementary palette. - GetSplitComplementaryPalette: Returns split complementary palette. - GetTetradicPalette: Returns tetradic palette. - GetTriadicPalette: Returns triadic palette.

The Color Wheel API can also take a palette of color names and tell you if it matches a specific color scheme: - CheckAnalogous: Returns true if the three colors match an Analogous palette and false if it doesn't. - CheckComplementary: Returns true if the three colors match a Complementary palette and false if it doesn't. - CheckSplitComplementary: Returns true if the three colors match an Split Complementary palette and false if it doesn't. - CheckTetradic: Returns true if the four colors match an Tetradic palette and false if it doesn't. - CheckTriadic: Returns true if the three colors match a Triadic palette and false if it doesn't.

endpoints

get[scheme]palette example


request

https://colorwheelapi20190205024526.azurewebsites.net/api/GetAnalogousPalette/Red


(NOTE:) I may need to turn off the API from time to time in order to keep hosting costs down.

response

alt text

check[scheme] example


request

`https://colorwheelapi20190205024526.azurewebsites.net/api/CheckAnalogous/Yellow,Yellow-Orange,Yellow-Green

(NOTE:) I may need to turn off the API from time to time in order to keep hosting costs down.

response

alt text

methods

Each controller has a two Get methods. One method handles the Get[scheme]Palette route and takes a single color, verifies the inbound color exists in the database, creates a palette if the color is in the specified palette table, and returns an error if either the palette or color is null. If not, it creates a Color object for each color in the palette, puts it in a list, and then returns the list of Color objects via the ASP.NET Core OK method. The other Get method handles the Check[scheme] route. It takes in 3-4 colors, verifies they are in the database, and returns an error if they are not. If they are in the database, the colors are thrown into a palette and then compared against the scheme specified in the route. If it exists, the colors match the scheme and a true response is sent back. If it doesn't, the colors don't match within the scheme and a false response is sent.

schema

alt text

notes

  • Colors sent to an endpoint must be sent via a capitalized string, i.e. Red
  • Colors that are made up of two color names must have both names capitalized and a dash between them, i.e. Yellow-Green

versions:

Version 1.0 February 01, 2019
Version 1.4 February 05, 2019
Version 1.5 July 19, 2023 (small changes to ensure API still running on Azure -Carlos)

authors

Carlos Castillo - castillocarlosr
How to contact Carlos?

xxp7cl@m.hackerx.org 

Charles Clemens - CClemensJr

license

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages