Code Monkey home page Code Monkey logo

colorwheel-api's Introduction

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

response

alt text

check[scheme] example


request

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

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 capitalize string, i.e. Red
  • Colors that are made up of two color names must have a 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

authors

Carlos Castillo - Initial work - castillocarlosr

Charles Clemens - Initial work - CClemensJr

license

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

colorwheel-api's People

Contributors

cclemensjr avatar castillocarlosr avatar dezteague avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.