Brand gradient

Codecademy gradient

The gradient Codecademy's published colour tokens imply, derived by a pure function of the palette: primary → secondary in OKLab (OKLCH shorter hue when the hues are more than 140° apart; a tonal ramp when they are within ΔE 0.15), then a hero background with an ink that passes AA at the worst point along the line, a button surface with hover and active states, and the variant contact sheet. Same inputs, same gradients, forever — which is what makes them citable; the same values are served as --brand-gradient in the brand's brand.css.

Extracted
Version
3
Verified from the live site at codecademy.com on 2 September 2026 (version 3).
Codecademy
white text · worst 4.85:1 · AA
white 4.85 AAblack 1.14 failsbanding high

Hero and button

Aa

Hero background

Open in maker →

Chroma ×0.35 so it can carry text; ink white (inkFor at the midpoint). Passes AA for that ink at the worst point (4.89:1) without adjusting L.

white 4.89 AAblack 1.14 failsbanding high
css
linear-gradient(135deg in oklch shorter hue, #667379 0%, #354146 50%, #0e151a 100%)
tailwind v4
bg-linear-to-br/oklch from-[#667379] via-[#354146] to-[#0e151a]
Aa

Button / CTA

Open in maker →

ΔL 0.08 top→bottom in the primary's hue (a lit surface, not a rainbow); hover L +0.03, active L −0.03. White ink passes AA on the surface and both states (worst 7.81:1).

white 8.86 AAblack 1.70 failsbanding high
Get started
hover
active
label ink passes AA on all three
css
linear-gradient(180deg in oklch shorter hue, #274f5f 0%, #103949 100%)
tailwind v4
bg-linear-to-b/oklch from-[#274f5f] to-[#103949]

Variants

Aa
white 4.85 AAblack 1.14 failsbanding high
css
linear-gradient(135deg in oklch shorter hue, #4f7788 0%, #1c4454 50%, #001625 100%)
tailwind v4
bg-linear-to-br/oklch from-[#4f7788] via-[#1c4454] to-[#001625]
Aa

Partner hue from the analogous rule at the source colour's lightness.

white 10.35 AAblack 2.00 failsbanding high
css
linear-gradient(135deg in oklab, #1c4454 0%, #1d4647 100%)
tailwind v4
bg-linear-to-br/oklab from-[#1c4454] to-[#1d4647]
Aa

Complementary

Open in maker →

Partner hue from the complementary rule at the source colour's lightness. ΔH 180° > 140° — interpolating in oklch (shorter hue) keeps the midpoint saturated.

white 10.23 AAblack 1.92 failsbanding high
css
linear-gradient(135deg in oklch shorter hue, #1c4454 0%, #5e3119 100%)
tailwind v4
bg-linear-to-br/oklch from-[#1c4454] to-[#5e3119]
Aa

Partner hue from the triadic rule at the source colour's lightness.

white 10.43 AAblack 1.85 failsbanding high
css
linear-gradient(135deg in oklab, #1c4454 0%, #661e4a 100%)
tailwind v4
bg-linear-to-br/oklab from-[#1c4454] to-[#661e4a]

Report — brand gradient

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

Export

The custom properties below are byte-identical to the gradient block in brand.css; the DTCG token is what tokens.json carries.

css custom properties · brand.css
:root {
  /* Brand gradient (derived) */
  /* worst-case contrast: white 4.85:1 AA, black 1.14:1 */
  --brand-gradient: linear-gradient(135deg in oklch shorter hue, #4f7788 0%, #1c4454 50%, #001625 100%);
  /* hero — worst-case contrast: white 4.89:1 AA, black 1.14:1; ink passes AA at the worst point */
  --brand-gradient-hero: linear-gradient(135deg in oklch shorter hue, #667379 0%, #354146 50%, #0e151a 100%);
  --brand-gradient-hero-ink: #ffffff;
  /* button — worst-case contrast: white 8.86:1 AA, black 1.70:1 */
  --brand-gradient-button: linear-gradient(180deg in oklch shorter hue, #274f5f 0%, #103949 100%);
  --brand-gradient-button-hover: linear-gradient(180deg in oklch shorter hue, #305768 0%, #194151 100%);
  --brand-gradient-button-active: linear-gradient(180deg in oklch shorter hue, #1f4757 0%, #063241 100%);
  --brand-gradient-button-ink: #ffffff;
}
svg · brand gradient
<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="#4f7788"/><stop offset="3.57%" stop-color="#4b7384"/><stop offset="7.14%" stop-color="#486f80"/><stop offset="10.71%" stop-color="#446c7d"/><stop offset="14.29%" stop-color="#406879"/><stop offset="17.86%" stop-color="#3d6475"/><stop offset="21.43%" stop-color="#396171"/><stop offset="25%" stop-color="#355d6d"/><stop offset="28.57%" stop-color="#32596a"/><stop offset="32.14%" stop-color="#2e5666"/><stop offset="35.71%" stop-color="#2b5262"/><stop offset="39.29%" stop-color="#274f5f"/><stop offset="42.86%" stop-color="#234b5b"/><stop offset="46.43%" stop-color="#204758"/><stop offset="50%" stop-color="#1c4454"/><stop offset="53.57%" stop-color="#1a4051"/><stop offset="57.14%" stop-color="#173d4d"/><stop offset="60.71%" stop-color="#153a4a"/><stop offset="64.29%" stop-color="#123646"/><stop offset="67.86%" stop-color="#103343"/><stop offset="71.43%" stop-color="#0d2f3f"/><stop offset="75%" stop-color="#0b2c3c"/><stop offset="78.57%" stop-color="#082939"/><stop offset="82.14%" stop-color="#062635"/><stop offset="85.71%" stop-color="#052232"/><stop offset="89.29%" stop-color="#031f2f"/><stop offset="92.86%" stop-color="#021c2b"/><stop offset="96.43%" stop-color="#011928"/><stop offset="100%" stop-color="#001625"/></linearGradient></defs><rect width="1440" height="600" fill="url(#bs-gradient)"/></svg>
dtcg · tokens.json
{
  "gradient": {
    "brand": {
      "$type": "gradient",
      "$value": [
        {
          "color": {
            "colorSpace": "srgb",
            "components": [
              0.31,
              0.467,
              0.533
            ],
            "hex": "#4f7788"
          },
          "position": 0
        },
        {
          "color": {
            "colorSpace": "srgb",
            "components": [
              0.11,
              0.267,
              0.329
            ],
            "hex": "#1c4454"
          },
          "position": 0.5
        },
        {
          "color": {
            "colorSpace": "srgb",
            "components": [
              0,
              0.086,
              0.145
            ],
            "hex": "#001625"
          },
          "position": 1
        }
      ],
      "$extensions": {
        "com.brandsweets": {
          "kind": "linear",
          "css": "linear-gradient(135deg in oklch shorter hue, #4f7788 0%, #1c4454 50%, #001625 100%)",
          "interpolation": "oklch",
          "hue": "shorter",
          "angle": 135,
          "name": "brand",
          "contrast": {
            "white": {
              "ratio": 4.854,
              "at": 0,
              "passesAA": true,
              "passesAALarge": true
            },
            "black": {
              "ratio": 1.141,
              "at": 1,
              "passesAA": false,
              "passesAALarge": false
            },
            "suggestedInk": "#ffffff"
          }
        }
      },
      "$description": "The canonical brand gradient (--brand-gradient)."
    },
    "hero": {
      "$type": "gradient",
      "$value": [
        {
          "color": {
            "colorSpace": "srgb",
            "components": [
              0.4,
              0.451,
              0.475
            ],
            "hex": "#667379"
          },
          "position": 0
        },
        {
          "color": {
            "colorSpace": "srgb",
            "components": [
              0.208,
              0.255,
              0.275
            ],
            "hex": "#354146"
          },
          "position": 0.5
        },
        {
          "color": {
            "colorSpace": "srgb",
            "components": [
              0.055,
              0.082,
              0.102
            ],
            "hex": "#0e151a"
          },
          "position": 1
        }
      ],
      "$extensions": {
        "com.brandsweets": {
          "kind": "linear",
          "css": "linear-gradient(135deg in oklch shorter hue, #667379 0%, #354146 50%, #0e151a 100%)",
          "interpolation": "oklch",
          "hue": "shorter",
          "angle": 135,
          "name": "hero",
          "ink": "#ffffff",
          "contrast": {
            "white": {
              "ratio": 4.891,
              "at": 0,
              "passesAA": true,
              "passesAALarge": true
            },
            "black": {
              "ratio": 1.141,
              "at": 1,
              "passesAA": false,
              "passesAALarge": false
            },
            "suggestedInk": "#ffffff"
          }
        }
      },
      "$description": "Low-chroma hero background with a text-safe ink (--brand-gradient-hero)."
    },
    "button": {
      "$type": "gradient",
      "$value": [
        {
          "color": {
            "colorSpace": "srgb",
            "components": [
              0.153,
              0.31,
              0.373
            ],
            "hex": "#274f5f"
          },
          "position": 0
        },
        {
          "color": {
            "colorSpace": "srgb",
            "components": [
              0.063,
              0.224,
              0.286
            ],
            "hex": "#103949"
          },
          "position": 1
        }
      ],
      "$extensions": {
        "com.brandsweets": {
          "kind": "linear",
          "css": "linear-gradient(180deg in oklch shorter hue, #274f5f 0%, #103949 100%)",
          "interpolation": "oklch",
          "hue": "shorter",
          "angle": 180,
          "name": "button",
          "ink": "#ffffff",
          "states": {
            "hover": "linear-gradient(180deg in oklch shorter hue, #305768 0%, #194151 100%)",
            "active": "linear-gradient(180deg in oklch shorter hue, #1f4757 0%, #063241 100%)"
          },
          "contrast": {
            "white": {
              "ratio": 8.861,
              "at": 0,
              "passesAA": true,
              "passesAALarge": true
            },
            "black": {
              "ratio": 1.703,
              "at": 0.9841,
              "passesAA": false,
              "passesAALarge": false
            },
            "suggestedInk": "#ffffff"
          }
        }
      },
      "$description": "Button / CTA surface with hover and active states (--brand-gradient-button)."
    }
  }
}

Colours

mcpConnect your agent — Codecademy's gradients on demand
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

brand_gradients for codecademy-com — give me the hero CSS and the ink that passes AA, then a version in oklch

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

Codecademy and its marks belong to their owner. This page uses the name nominatively to describe gradients derived from the brand's published colour values; it does not reproduce logos or other brand assets, and it is not affiliated with or endorsed by Codecademy. Owner of this brand? Request a correction or removal → Machine-readable: gradients.md