Overlay blend two colors
This overlay color blender combines a base color and a blend color using the standard overlay operation found in graphics software.
Run — free
Every red, green, and blue channel is evaluated separately: darker base channels use multiply, while lighter base channels use screen. Enter three-digit or six-digit hex colors and receive a normalized hex result, numeric RGB channels, and a ready-to-use CSS RGB string. The calculation is deterministic, requires no image upload, and validates both inputs before producing an answer.
How overlay blending chooses its formula
Overlay is a contrast-producing blend mode rather than an average of two colors. The calculator first converts each hexadecimal component into a value from zero to one. It then examines the base component, independently for red, green, and blue. When that base value is at or below one half, the component follows multiply-style math: two times the base times the blend. When the base is above one half, it follows screen-style math: one minus two times the remaining distance of both components from one. This branch is selected separately for every channel, so a single result can use multiply for red and screen for blue. The normalized result is converted back to the zero-to-255 RGB range and rounded to the nearest integer. That explicit sequence makes the output reproducible and matches the usual non-alpha overlay definition used by graphics tools. The base and blend positions matter; exchanging the two inputs can change which branch is selected and therefore can produce a different color.
Enter colors and interpret the result
Provide a base color and a blend color in hexadecimal notation. Both the familiar six-digit form, such as #336699, and the compact three-digit form, such as #369, are accepted. The leading hash is optional, but alpha channels, color names, CSS functions, and extra whitespace inside the digits are rejected. Compact values are expanded before calculation, and accepted inputs are returned as uppercase six-digit hex strings so logs and tests have a consistent representation. The response includes the blended hex color, an RGB object with integer red, green, and blue fields, and an rgb(...) string that can be pasted into CSS. It also echoes the normalized inputs and identifies the mode as overlay. Validation happens before any channel calculation. If either field is absent, is not a string, contains a non-hexadecimal character, or has the wrong length, the request returns an invalid-input error instead of silently guessing. This strict behavior is useful in build systems where a plausible but unintended color would be harder to detect than a clear failure.
Use deterministic overlay results in design workflows
Use this calculator when a design specification names overlay blending but you need a concrete flat color rather than a layered document. It is helpful for generating theme tokens, checking a graphics-editor result, producing fixture values for rendering tests, or calculating a fallback color for a system that cannot preserve blend modes. Because the operation works on color channels only, it does not inspect pixels, opacity, color profiles, gradients, or surrounding artwork. If a layer includes transparency, composite that alpha separately or use an image-processing workflow that understands the full layer stack. Also remember that this calculation uses encoded RGB channel values directly; it does not linearize sRGB light or perform a perceptual color-space mix. Those properties are intentional because they make the result correspond to the conventional overlay formula that designers expect. Browser use is free, while automated API requests cost $0.002 each. The same pure calculation drives both paths, with no network lookup, random state, or current-time dependency, so identical validated inputs always produce identical output.
What you can do with it
Flatten a design token
Turn a base and overlay layer color into one stable hex token for a theme or component library.
Verify graphics software output
Compare a tool's overlay result with an independent per-channel calculation during visual QA.
Create rendering test fixtures
Generate deterministic RGB expectations for blend-mode unit tests and cross-platform snapshots.
FAQ
What does an API request cost?
Each API request costs $0.002. You can also run the same calculation free in your browser.
Does input order matter?
Yes. The base color decides whether multiply or screen is used for each channel, so swapping base and blend can change the result.
Which color formats are accepted?
Three-digit and six-digit hexadecimal RGB colors are accepted, with or without a leading #. Alpha, names, and CSS color functions are not accepted.
How are channel values rounded?
Each normalized overlay result is multiplied by 255 and rounded to the nearest integer, then formatted as uppercase hexadecimal.
Does this blend images or transparency?
No. It combines two opaque RGB colors only. Pixel grids, alpha compositing, gradients, and color profiles are outside this capability.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/color/overlay \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"base":"#336699","blend":"#FFCC00"}'const res = await fetch("https://api.kit.forhosting.com/color/overlay", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"base": "#336699",
"blend": "#FFCC00"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/color/overlay",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"base": "#336699",
"blend": "#FFCC00"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/color/overlay", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"base":"#336699","blend":"#FFCC00"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"base":"#336699","blend":"#FFCC00"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/color/overlay", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"base": "#336699",
"blend": "#FFCC00"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "color.overlay",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |