# Color Similarity Calculator API

> Color Similarity Calculator measures color similarity between two hex values. It returns an overall similarity score, a categorical match rating, and RGB and HSL channel breakdowns, while paid plans add Delta E and color distance metrics.

**Endpoint:** `GET https://api.apiverve.com/v1/colorsimilarity`  
**Category:** Math/Calculations  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/colorsimilarity

## Overview

Color Similarity Calculator compares two hex colors and tells you how close they are. It works by converting hex colors to RGB and HSL, calculating Euclidean distance in color space, and comparing hue, saturation, and lightness differences. Send color1 and color2, with or without the # prefix, and get back both colors broken out into RGB and HSL, an overall similarity percentage, a plain-language rating from very different to nearly identical, and a flag that says whether the two values are the same color.

Designers use it to catch near-duplicate swatches in a palette, to check a brand color against what a product or print proof actually shows, and to group user-chosen colors that are close enough to treat as one.

The Free plan returns the overall score, the rating and the channel breakdowns. Paid plans add the measurements behind the score: RGB distance and RGB similarity, HSL similarity, a Delta E color difference computed in CIE-LAB, and the separate hue, saturation and lightness gaps, so you can set your own color matching threshold instead of relying on the rating.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/colorsimilarity?color1=FF5733&color2=FF6B47" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `color1` | string | Yes | First hex color value (with or without # prefix). hexColor |
| `color2` | string | Yes | Second hex color value (with or without # prefix). hexColor |

## Response fields

- `color1` — object · The first colour, in hex, RGB and HSL
  - `color1.hex` — string · First color in hexadecimal format representation
  - `color1.rgb` — object · First colour as red, green and blue channels
    - `color1.rgb.r` — number · Red channel value for first color
    - `color1.rgb.g` — number · Green channel value for first color
    - `color1.rgb.b` — number · Blue channel value for first color
  - `color1.hsl` — object · First colour as hue, saturation and lightness
    - `color1.hsl.h` — number · Hue value for first color in degrees
    - `color1.hsl.s` — number · Saturation percentage for first color
    - `color1.hsl.l` — number · Lightness percentage for first color
- `color2` — object · The second colour, in hex, RGB and HSL
  - `color2.hex` — string · Second color in hexadecimal format representation
  - `color2.rgb` — object · Second colour as red, green and blue channels
    - `color2.rgb.r` — number · Red channel value for second color
    - `color2.rgb.g` — number · Green channel value for second color
    - `color2.rgb.b` — number · Blue channel value for second color
  - `color2.hsl` — object · Second colour as hue, saturation and lightness
    - `color2.hsl.h` — number · Hue value for second color in degrees
    - `color2.hsl.s` — number · Saturation percentage for second color
    - `color2.hsl.l` — number · Lightness percentage for second color
- `rgb_distance` — number · Euclidean distance between colors in RGB space · (premium)
- `rgb_similarity` — number · Percentage similarity based on RGB color space · (premium)
- `hsl_similarity` — number · Percentage similarity based on HSL color space · (premium)
- `overall_similarity` — number · Combined similarity percentage from all algorithms
- `delta_e` — number · Delta E color difference metric for perceptual similarity · (premium)
- `hue_difference` — number · Hue difference between colors in degrees · (premium)
- `saturation_difference` — number · Saturation percentage difference between colors · (premium)
- `lightness_difference` — number · Lightness percentage difference between colors · (premium)
- `similarity_category` — string · Human readable category describing similarity level
- `are_identical` — boolean · Boolean indicating if colors are exactly identical

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "color1": {
      "hex": "#FF5733",
      "rgb": {
        "r": 255,
        "g": 87,
        "b": 51
      },
      "hsl": {
        "h": 10.6,
        "s": 100,
        "l": 60
      }
    },
    "color2": {
      "hex": "#FF6B47",
      "rgb": {
        "r": 255,
        "g": 107,
        "b": 71
      },
      "hsl": {
        "h": 11.7,
        "s": 100,
        "l": 63.9
      }
    },
    "rgb_distance": 28.28,
    "rgb_similarity": 93.6,
    "hsl_similarity": 97.71,
    "overall_similarity": 95.65,
    "delta_e": 28.28,
    "hue_difference": 1.15,
    "saturation_difference": 0,
    "lightness_difference": 3.92,
    "similarity_category": "nearly identical",
    "are_identical": false
  }
}
```

## Use cases

- **Color Matching** — Find and compare similar colors for design consistency and brand compliance
- **Image Processing** — Compare colors in images for color correction and matching operations
- **Design Systems** — Validate color palette consistency and identify similar colors in design systems
- **Quality Control** — Compare product colors against standards for quality assurance and brand consistency

## SDKs

- **npm** — `npm install @apiverve/colorsimilarity` (https://www.npmjs.com/package/@apiverve/colorsimilarity)
- **NuGet** — `dotnet add package APIVerve.API.ColorSimilarityCalculator` (https://www.nuget.org/packages/APIVerve.API.ColorSimilarityCalculator)
- **Source** — https://github.com/apiverve/colorsimilarity-api

## More

- Full reference: https://docs.apiverve.com/ref/colorsimilarity
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
