Skip to content

🎨 Extract primary, secondary, and tertiary colors from images effortlessly.

Notifications You must be signed in to change notification settings

EddyDezuraud/image-color-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Color Theme

Image Color Theme is a simple API that extracts primary, secondary, and tertiary colors from images. It provides a straightforward way to integrate color extraction functionality into your applications.

How to Use

To use Image Color Theme, send a GET request to the following endpoint:

Replace yourImageUrl with the URL of the image from which you want to extract colors.

Example

const imageUrl = 'https://example.com/image.jpg';

fetch(`https://image-color-theme.vercel.app/api?url=${imageUrl}`)
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

Response Format

The API returns a JSON object containing primary, secondary, and tertiary colors along with their RGB and hexadecimal representations.

Example Response:

{
  "primary": {
    "rgb": "255,255,255",
    "hex": "#FFFFFF"
  },
  "secondary": {
    "rgb": "0,0,0",
    "hex": "#000000"
  },
  "tertiary": {
    "rgb": "128,128,128",
    "hex": "#808080"
  }
}

Dependencies

  • express: Web framework for Node.js
  • get-image-colors: Library for extracting colors from images

Running Locally

  1. Clone the repository: git clone https://github.com/your-username/image-color-theme.git
  2. Install dependencies: npm install
  3. Start the server: npm start

By default, the server will listen on port 5566. You can customize the port using the PORT environment variable.

About

🎨 Extract primary, secondary, and tertiary colors from images effortlessly.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published