Colour to colour

Cobalt Blue to Midnight Blue gradient

Cobalt Blue (#0047ab) into Midnight Blue (#191970) — 13° apart on the OKLCH hue wheel. Below: the same two stops interpolated in OKLab and in OKLCH, side by side, because the difference is real and most generators never let you see it; then an eased version and a mesh, each with the worst-case contrast for white and black text. The engine's own pick for this pair is oklab — both colours are in the palette and the hue gap is small enough that the straight line stays clean.

Cobalt Blue → Midnight Blue
white text · worst 8.43:1 · AA
white 8.43 AAblack 1.41 failsbanding high

OKLab and OKLCH, side by side

Aa

A straight line through the a/b plane: the two hues meet halfway and desaturate a little at the midpoint. The safe default — it is what CSS and Tailwind default to.

white 8.43 AAblack 1.41 failsbanding high
css
linear-gradient(135deg in oklab, #0047ab 0%, #191970 100%)
Aa

OKLCH (shorter hue)

Open in maker →

Chroma and hue interpolate separately, so the midpoint keeps its saturation and the hue travels the short way round the wheel — richer, and it can pass through hues neither colour has.

white 8.43 AAblack 1.41 failsbanding high
css
linear-gradient(135deg in oklch shorter hue, #0047ab 0%, #191970 100%)

And the sRGB line most tools draw, for comparison — the number is the chroma that survives at the dullest point.

sRGB91%
OKLab91%
OKLCH91%

Eased and mesh

Aa

Eased (soft)

Open in maker →

A cubic-bezier(.4, 0, .6, 1) mix ratio baked into 15 stops: the transition lingers on each colour and moves faster through the middle, which is what makes a gradient read as designed rather than default.

white 8.43 AAblack 1.41 failsbanding high
css
linear-gradient(135deg in oklab, #0047ab 0%, #0146aa 8.28%, #0444a8 16.03%, #0742a4 23.35%, #0c3e9f 30.32%, #0f3a99 37.03%, #123593 43.56%, #15308d 50%, #162b87 56.44%, #172781 62.97%, #18227b 69.68%, #191f77 76.65%, #191c73 83.97%, #191a71 91.72%, #191970 100%)
Aa

Both colours as stacked radials over a base, laid out by a seeded Poisson-disc sampler — the same seed gives the same mesh forever. Exports as CSS, SVG and PNG.

white 11.15 AAblack 1.65 failsbanding high
css
background-color: #15308d;
background-image: radial-gradient(circle farthest-corner at 10.9% 80.58%, rgba(0, 71, 171, 0.715) 0%, rgba(0, 71, 171, 0) 46.24%), radial-gradient(circle farthest-corner at 93.74% 57.98%, rgba(25, 25, 112, 0.759) 0%, rgba(25, 25, 112, 0) 45.66%);
background-image: radial-gradient(circle farthest-corner at 10.9% 80.58%, oklch(from #0047ab l c h / 0.7145) 0%, rgb(from #0047ab r g b / 0) 46.24%), radial-gradient(circle farthest-corner at 93.74% 57.98%, oklch(from #191970 l c h / 0.7586) 0%, rgb(from #191970 r g b / 0) 45.66%);

Report

  • white ink: worst 8.43:1 at 1% (AA); black ink: worst 1.41:1 at 100% (fails AA) → use white text.
  • Banding high: ~24px bands at 1440px — add grain 46 (≈3% soft-light noise) or shorten the ramp.

Export

css
.gradient {
  background-image: linear-gradient(135deg, #0047ab 0%, #0544a7 7.14%, #0940a2 14.29%, #0c3d9e 21.43%, #0f3a9a 28.57%, #113795 35.71%, #133391 42.86%, #15308d 50%, #162d89 57.14%, #172a85 64.29%, #182680 71.43%, #18237c 78.57%, #192078 85.71%, #191c74 92.86%, #191970 100%);
  background-image: linear-gradient(135deg in oklab, #0047ab 0%, #191970 100%);
}
tailwind v4
bg-linear-to-br/oklab from-[#0047ab] to-[#191970]
svg
<svg xmlns="http://www.w3.org/2000/svg" width="1440" height="600" viewBox="0 0 1440 600"><defs><linearGradient id="bs-gradient" gradientUnits="userSpaceOnUse" x1="210" y1="-210" x2="1230" y2="810"><stop offset="0%" stop-color="#0047ab"/><stop offset="7.14%" stop-color="#0544a7"/><stop offset="14.29%" stop-color="#0940a2"/><stop offset="21.43%" stop-color="#0c3d9e"/><stop offset="28.57%" stop-color="#0f3a9a"/><stop offset="35.71%" stop-color="#113795"/><stop offset="42.86%" stop-color="#133391"/><stop offset="50%" stop-color="#15308d"/><stop offset="57.14%" stop-color="#162d89"/><stop offset="64.29%" stop-color="#172a85"/><stop offset="71.43%" stop-color="#182680"/><stop offset="78.57%" stop-color="#18237c"/><stop offset="85.71%" stop-color="#192078"/><stop offset="92.86%" stop-color="#191c74"/><stop offset="100%" stop-color="#191970"/></linearGradient></defs><rect width="1440" height="600" fill="url(#bs-gradient)"/></svg>
dtcg
{
  "cobalt-to-midnightblue": {
    "$type": "gradient",
    "$value": [
      {
        "color": {
          "colorSpace": "srgb",
          "components": [
            0,
            0.278,
            0.671
          ],
          "hex": "#0047ab"
        },
        "position": 0
      },
      {
        "color": {
          "colorSpace": "srgb",
          "components": [
            0.098,
            0.098,
            0.439
          ],
          "hex": "#191970"
        },
        "position": 1
      }
    ],
    "$extensions": {
      "com.brandsweets": {
        "kind": "linear",
        "css": "linear-gradient(135deg in oklab, #0047ab 0%, #191970 100%)",
        "interpolation": "oklab",
        "angle": 135,
        "name": "cobalt-to-midnightblue",
        "contrast": {
          "white": {
            "ratio": 8.432,
            "at": 0.0082,
            "passesAA": true,
            "passesAALarge": true
          },
          "black": {
            "ratio": 1.414,
            "at": 1,
            "passesAA": false,
            "passesAALarge": false
          },
          "suggestedInk": "#ffffff"
        }
      }
    },
    "$description": "Cobalt Blue to Midnight Blue, interpolated in oklab."
  }
}
mcpConnect your agent to the gradient engine
live endpoint

Point any MCP client at the shared gradients endpoint and your agent gets the same engine as this page — make_gradient returns CSS with the interpolation space, Tailwind v4, SVG, a PNG URL, a DTCG token and the contrast report in one call; brand_gradients derives the whole contact sheet from a brand or a palette. Read-only, no key. Every gradient is a /gradients/new/… link: open it, refine, paste it back.

endpointhttps://mcp.brandsweets.com/gradients/mcp
claude mcp add --transport http brandsweets-gradients https://mcp.brandsweets.com/gradients/mcp
try this prompt

make a cobalt blue to midnight blue hero gradient in oklch that passes AA for white text, with grain if it bands

Want the agent to remember your picks and write them into a living brand? Create a free BrandSweets workspace.

Machine-readable: gradients.md