Colour mixer
Mix two colours by any ratio in sRGB or OKLab, or lighten or darken a colour by a percentage.
Input
Result
Fill in the input and press Run.
Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.
Use it from code or an agent
curl -s https://setget.net/v1/tools/color-blend \
-H 'Content-Type: application/json' \
-d '{"input":{"color":"#ff0000","other":"#0000ff"}}'
import json, urllib.request
body = {'input': {'color': '#ff0000', 'other': '#0000ff'}}
request = urllib.request.Request("https://setget.net/v1/tools/color-blend", json.dumps(body).encode(),
{"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/color-blend", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"color":"#ff0000","other":"#0000ff"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "color-blend",
"input": {
"color": "#ff0000",
"other": "#0000ff"
}
}
{
"input": {
"color": "#ff0000",
"other": "#0000ff"
}
}
Endpoint: POST /v1/tools/color-blend. Over MCP: run_tool with slug: "color-blend".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
color |
string | yes | The starting colour, in any CSS format. |
other |
string | no | The colour to mix in. Needed for mode "mix". |
mode |
string | no | mix blends towards "other", lighten towards white, darken towards black. One of: mix, lighten, darken. Default: "mix". |
amount |
number | no | How far to go, in percent. 0 keeps the starting colour, 100 gives the other one. Default: 50. From 0 to 100. |
space |
string | no | Colour space to mix in. OKLab gives more even, natural steps. One of: srgb, oklab. Default: "srgb". |
Examples
Input
{
"color": "#ff0000",
"other": "#0000ff"
}Result
{
"hex": "#800080",
"rgb": "rgb(128, 0, 128)",
"hsl": "hsl(300, 100%, 25%)",
"alpha": 1,
"mode": "mix",
"amount": 50,
"space": "srgb"
}The same mix in OKLab
Input
{
"color": "#ff0000",
"other": "#0000ff",
"space": "oklab"
}Result
{
"hex": "#8c53a2",
"rgb": "rgb(140, 83, 162)",
"hsl": "hsl(283.4, 32.3%, 48.1%)",
"alpha": 1,
"mode": "mix",
"amount": 50,
"space": "oklab"
}Lighten by 20%
Input
{
"color": "#0088cc",
"mode": "lighten",
"amount": 20
}Result
{
"hex": "#33a0d6",
"rgb": "rgb(51, 160, 214)",
"hsl": "hsl(200, 66.7%, 52%)",
"alpha": 1,
"mode": "lighten",
"amount": 20,
"space": "srgb"
}Questions
- Which colour formats can I type?
- Hex (#rgb, #rrggbb, #rrggbbaa), rgb() and rgba(), hsl() and hsla(), hwb(), oklab(), oklch(), and any of the 148 CSS colour names such as "rebeccapurple".
- Why do sRGB and OKLab give different mixes?
- sRGB averages the raw red, green and blue numbers, which can look dark or muddy in the middle. OKLab is built around how people see colour, so the steps look more even. CSS color-mix() uses OKLab by default.
- What do lighten and darken do exactly?
- They mix the colour with white or black by the given percentage, which designers call a tint or a shade.
Related tools
- Colour converterConvert a colour between hex, RGB, HSL, HWB, OKLab and OKLCH, and find the nearest CSS colour name.
color-convert - Colour palette generatorBuild colour schemes from one base colour: complementary, analogous, triadic and a 50 to 950 shade scale.
palette-generate - CSS gradient generatorBuild a CSS linear, radial or conic gradient from a list of colour stops, with an SVG preview.
css-gradient - Colour contrast checkerCheck the WCAG contrast ratio between text and background colours, with AA and AAA pass or fail.
contrast-ratio - Add or subtract time from a dateAdd or subtract years, months, weeks, days, hours and minutes from a date and get the resulting date.
date-add - Age calculatorWork out an exact age in years, months and days on a given date, plus the next birthday.
age-calculator