Subtractive color mixer
Yellow #FFFF00 and blue #0000FF mixed half and half like paint give green #008000, not the gray a screen-light blend would produce. Show how pigments behave in lessons, craft guides and illustrations. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Color1
- #FFFF00
- Color2
- #0000FF
- Ratio
- 50
- T
- 0.5
- Hex
- #008000
- Rgb string
- rgb(0, 128, 0)
Digital colour tools almost always mix light: red and blue become magenta because channels add in RGB. Painters and designers who think in pigment expect something else—red and blue should muddy toward purple-brown, yellow and blue should pull toward green, and equal mixes of complementary paints should dull rather than brighten. This subtractive color mixer takes two hex colours and a ratio, converts them into RYB pigment coordinates, blends those coordinates as if you mixed wet paint, and returns the resulting sRGB hex and channels. Use it when you need intuitive pigment blends for illustration, craft tutorials, educational demos of subtractive colour theory, or design systems that should not pretend paint behaves like screen light.
How subtractive RYB mixing differs from RGB light blending
Additive mixing models how coloured lights combine on a display: red light plus green light yields yellow, and more light generally means a brighter result. Subtractive mixing models pigments and dyes: each pigment absorbs some wavelengths, and combining pigments absorbs more, so mixes tend toward darker, duller results rather than pure secondary light. This capability implements a classic paint-inspired path.
First each input hex is parsed into sRGB channel values from zero to two hundred fifty-five. Those channels are mapped into red-yellow-blue pigment space with a redistribution that extracts yellow from red-plus-green and folds residual green into yellow and blue, following the paint-inspired conversion popularized in visualization research. Compared with a pure RGB lerp, red mixed with blue at fifty percent is no longer a clean mid-magenta; the pigment path yields a more brownish or purple-mud result that matches how learners describe mixing paint.
Yellow and cyan-ish blues pull toward greens. Complementary pairs dull. That is the intentional product difference from the existing RGB color mixer in the catalog, which remains the right tool when you want screen-light interpolation.
Where a subtractive pigment mixer earns its place
Art education sites and STEAM lesson builders need a live demo that answers “what happens if I mix this red with that blue like paint?” without shipping a full colour-management stack. Craft and DIY generators that suggest yarn, resin tint, or watercolour combinations should not use light-add math if the user is thinking in tubes of pigment.
Keep requests tiny, store the returned hex for reproducible design tokens, and treat invalid hex as client errors rather than retries. If you need linear RGB blends for UI theming, use the additive color mixer instead; if you need paint intuition, this is the dedicated path.
What you can do with it
Art and colour-theory lessons
Show students how red and blue paint muddies differently from red and blue light, with deterministic hex results for worksheets and LMS checks.
Craft and pigment product previews
Preview yarn, ink, or resin tint blends as paint-like mixes before physical samples, using ratio for recipe shares.
Design tools with a paint-mix mode
Offer a subtractive mix control in editors and generators that should not use RGB lerp for pigment-style swatches.
FAQ
How do I mix two colours subtractively like paint?
Send color1 and color2 as hex strings and ratio from 0 to 100 (share of color2).
How is this different from a normal color mixer?
A normal RGB mixer interpolates light channels (red+blue→magenta).
What hex formats are accepted?
Three- or six-digit hex with optional # or 0x, case-insensitive.
What does ratio mean?
ratio is the percentage of color2 in the pigment mix: 0 returns color1, 100 returns color2, 50 is an even RYB blend. Values outside 0–100 are rejected.
What color do yellow and blue make when mixed like paint?
Green. Mixing #FFFF00 and #0000FF at 50 gives #008000, with red 0, green 128 and blue 0, which matches what happens when you mix yellow and blue paint.
Related tools
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/mix-subtractive \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"color1":"#FF0000","color2":"#0000FF","ratio":50}'const res = await fetch("https://api.kit.forhosting.com/color/mix-subtractive", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"color1": "#FF0000",
"color2": "#0000FF",
"ratio": 50
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/color/mix-subtractive",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"color1": "#FF0000",
"color2": "#0000FF",
"ratio": 50
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/color/mix-subtractive", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"color1":"#FF0000","color2":"#0000FF","ratio":50}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"color1":"#FF0000","color2":"#0000FF","ratio":50}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/color/mix-subtractive", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"color1": "#FF0000",
"color2": "#0000FF",
"ratio": 50
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "color.mix_subtractive",
"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. |
Technical notes
How subtractive RYB mixing differs from RGB light blending
In RYB space the two colours are blended with a linear weight controlled by the ratio: zero keeps the first pigment pure, one hundred keeps the second pure, and fifty is an even mix. The blended RYB triple is mapped back to sRGB, channels are rounded to integers, and the result is emitted as uppercase hex plus an rgb object and rgb_string.
Input contract, response fields, and validation rules
POST a JSON body with three required fields. color1 and color2 are hex colour strings: three or six hexadecimal digits, optional leading hash or zero-x prefix, case-insensitive; the response normalizes them to six-digit uppercase with a hash. ratio is a finite number from zero to one hundred inclusive, representing the percentage share of color2 in the pigment blend. Missing fields, empty strings, non-hex characters, wrong digit lengths, non-finite ratio, and ratio outside zero to one hundred all fail with invalid_input and a message that names the problem; failed validation is not billed. On success the body echoes color1, color2, ratio, and t (ratio divided by one hundred); returns hex, rgb, and rgb_string for the mix; echoes color1_rgb and color2_rgb; and includes color1_ryb, color2_ryb, and mixed_ryb intermediate triples rounded for stable clients, plus method set to ryb_subtractive so consumers can tell this result from an RGB lerp.
Where a subtractive pigment mixer earns its place
Illustration and concept-art tools that expose a “mix like paint” control can call this parse endpoint for a deterministic swatch, then let the artist refine by hand.
Technical questions
What does the subtractive color mixer cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.