Colour to colour

Royal Blue to Midnight Blue gradient

Royal Blue (#4169e1) into Midnight Blue (#191970) — 6° 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.

Royal Blue → Midnight Blue
white text · worst 4.85:1 · AA
white 4.85 AAblack 1.41 failsbanding medium

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 4.85 AAblack 1.41 failsbanding medium
css
linear-gradient(135deg in oklab, #4169e1 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 4.85 AAblack 1.41 failsbanding medium
css
linear-gradient(135deg in oklch shorter hue, #4169e1 0%, #191970 100%)

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

sRGB87%
OKLab87%
OKLCH87%

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 4.85 AAblack 1.41 failsbanding medium
css
linear-gradient(135deg in oklab, #4169e1 0%, #4068df 8.28%, #3f64da 16.03%, #3c5fd3 23.35%, #3859ca 30.32%, #3451bf 37.03%, #3049b3 43.56%, #2c41a7 50%, #27389b 56.44%, #243090 62.97%, #202985 69.68%, #1d237d 76.65%, #1b1e76 83.97%, #191a72 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 7.47 AAblack 1.62 failsbanding high
css
background-color: #2c41a7;
background-image: radial-gradient(circle farthest-corner at 5.63% 62.39%, rgba(65, 105, 225, 0.745) 0%, rgba(65, 105, 225, 0) 54.68%), radial-gradient(circle farthest-corner at 65.43% 81.02%, rgba(25, 25, 112, 0.887) 0%, rgba(25, 25, 112, 0) 54.25%);
background-image: radial-gradient(circle farthest-corner at 5.63% 62.39%, oklch(from #4169e1 l c h / 0.7451) 0%, rgb(from #4169e1 r g b / 0) 54.68%), radial-gradient(circle farthest-corner at 65.43% 81.02%, oklch(from #191970 l c h / 0.8868) 0%, rgb(from #191970 r g b / 0) 54.25%);

Report

  • white ink: worst 4.85:1 at 0% (AA); black ink: worst 1.41:1 at 100% (fails AA) → use white text.
  • Banding medium: ~13px bands at 1440px — add grain 27 (≈2% soft-light noise) or shorten the ramp.

Export

css
.gradient {
  background-image: linear-gradient(135deg, #4169e1 0%, #3e63d9 7.14%, #3b5dd0 14.29%, #3857c8 21.43%, #3552bf 28.57%, #324cb7 35.71%, #2f46af 42.86%, #2c41a7 50%, #293b9f 57.14%, #263597 64.29%, #23308f 71.43%, #212a87 78.57%, #1e247f 85.71%, #1b1f78 92.86%, #191970 100%);
  background-image: linear-gradient(135deg in oklab, #4169e1 0%, #191970 100%);
}
tailwind v4
bg-linear-to-br/oklab from-[#4169e1] 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="#4169e1"/><stop offset="7.14%" stop-color="#3e63d9"/><stop offset="14.29%" stop-color="#3b5dd0"/><stop offset="21.43%" stop-color="#3857c8"/><stop offset="28.57%" stop-color="#3552bf"/><stop offset="35.71%" stop-color="#324cb7"/><stop offset="42.86%" stop-color="#2f46af"/><stop offset="50%" stop-color="#2c41a7"/><stop offset="57.14%" stop-color="#293b9f"/><stop offset="64.29%" stop-color="#263597"/><stop offset="71.43%" stop-color="#23308f"/><stop offset="78.57%" stop-color="#212a87"/><stop offset="85.71%" stop-color="#1e247f"/><stop offset="92.86%" stop-color="#1b1f78"/><stop offset="100%" stop-color="#191970"/></linearGradient></defs><rect width="1440" height="600" fill="url(#bs-gradient)"/></svg>
dtcg
{
  "royalblue-to-midnightblue": {
    "$type": "gradient",
    "$value": [
      {
        "color": {
          "colorSpace": "srgb",
          "components": [
            0.255,
            0.412,
            0.882
          ],
          "hex": "#4169e1"
        },
        "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, #4169e1 0%, #191970 100%)",
        "interpolation": "oklab",
        "angle": 135,
        "name": "royalblue-to-midnightblue",
        "contrast": {
          "white": {
            "ratio": 4.847,
            "at": 0,
            "passesAA": true,
            "passesAALarge": true
          },
          "black": {
            "ratio": 1.414,
            "at": 1,
            "passesAA": false,
            "passesAALarge": false
          },
          "suggestedInk": "#ffffff"
        }
      }
    },
    "$description": "Royal Blue to Midnight Blue, interpolated in oklab."
  }
}

More from Royal Blue

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 royal 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