Skip to content

Extracts the dominant color from an image, facilitating easy analysis of image content for web developers and designers.

Notifications You must be signed in to change notification settings

shanerrr/color-spotlight

Repository files navigation

color-spotlight

https://nodei.co/npm/color-spotlight.png?downloads=true&downloadRank=true&stars=true

Overview

color-spotlight is a lightweight Node.js module that spotlights the dominant color in an image. It provides an easy-to-use interface for extracting the most prominent color from an image, making it ideal for web developers, designers, and anyone working with image analysis in their projects.

Features

  • Identifies and spotlights the dominant color in an image.
  • Supports various image formats, including PNG, JPEG, and others.
  • Simple API for integrating color analysis into your Node.js applications.

Installation

You can install color-spotlight via npm:

npm install color-spotlight

Usage

const spotlight = require("color-spotlight");

// Specify the URL of the image you want to analyze
const imageUrl = "https://example.com/image.jpg";

// Get the dominant color from the image
spotlight(imageUrl)
  .then((color) => {
    console.log("Dominant color (RGB):", color.rgb);
    console.log("Dominant color (HEX):", color.hex);
  })
  .catch((error) => {
    console.error("Error:", error.message);
  });

// or using async/await
const { rgb, hex } = await spotlight(imageUrl);

About

Extracts the dominant color from an image, facilitating easy analysis of image content for web developers and designers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published