/vlz-color-analysis

API to analyze SVG colors for VectorLogoZone

Primary LanguageJavaScriptGNU Affero General Public License v3.0AGPL-3.0

Color Analysis TIL Logo

VLZ Color Analysis is an API (and web interface for testing it) to extract the colors used in an SVG file.

Really just a wrapper for get-svg-colors so it can be used from VectorLogoZone, which is a static site.

Running

It is a simple node app: npm install then node server.js.

Calling the API

The endpoint is /api. It takes a single parameter url that should be the full URL of an SVG file. Both GET and POST will work. Try it!

The return is a JSON object with a colors property that is an array of colors found in the SVG. Example:

{
  "success": true,
  "colors": [
    "#1D8286"
  ],
  "url": "https://www.vectorlogo.zone/logos/vectorlogozone/vectorlogozone-ar21.svg"
}

You can call is as JSONP by passing a callback parameter.

Contributing

Contributions are welcome! Please follow the standard Github Fork & Pull Request Workflow

License

GNU Affero General Public License v3.0

Credits

express.js Git Github Google Analytics Handlebars JavaScript Node.js npm Shoelace CSS Zeit