# Codecademy gradient

Gradients derived from Codecademy's published colour tokens (nominative use; no brand assets). Deterministic: the same values are served as `--brand-gradient*` in the brand's brand.css.

- Page: https://brandsweets.com/gradients/brands/codecademy-com
- Brand colors: https://brandsweets.com/colors/brands/codecademy-com · Brand page: https://brandsweets.com/b/codecademy-com
- Palette: primary #1c4454, secondary #2c4c5c, accents #dc2626
- Source: https://codecademy.com (extracted 2026-09-02)

## Brand gradient

ΔE_OK 0.034 < 0.15 between #1c4454 and #2c4c5c — a 2-stop would read as a flat fill, so this is a tonal ramp of #1c4454.

- CSS: `linear-gradient(135deg in oklch shorter hue, #4f7788 0%, #1c4454 50%, #001625 100%)`
- Tailwind: `bg-linear-to-br/oklch from-[#4f7788] via-[#1c4454] to-[#001625]`
- Contrast (worst point): white 4.85:1 AA · black 1.14:1 fail · banding high
- Maker: https://brandsweets.com/gradients/new/v1.4f7788-1c4454-001625?a=135&in=oklch&hue=shorter

## Hero background

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.

- CSS: `linear-gradient(135deg in oklch shorter hue, #667379 0%, #354146 50%, #0e151a 100%)`
- Tailwind: `bg-linear-to-br/oklch from-[#667379] via-[#354146] to-[#0e151a]`
- Contrast (worst point): white 4.89:1 AA · black 1.14:1 fail · banding high · ink #ffffff
- Maker: https://brandsweets.com/gradients/new/v1.667379-354146-0e151a?a=135&in=oklch&hue=shorter

## Button / CTA

Δ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).

- CSS: `linear-gradient(180deg in oklch shorter hue, #274f5f 0%, #103949 100%)`
- Tailwind: `bg-linear-to-b/oklch from-[#274f5f] to-[#103949]`
- Contrast (worst point): white 8.86:1 AA · black 1.70:1 fail · banding high · ink #ffffff
- Maker: https://brandsweets.com/gradients/new/v1.274f5f-103949?a=180&in=oklch&hue=shorter
- Hover: `linear-gradient(180deg in oklch shorter hue, #305768 0%, #194151 100%)`
- Active: `linear-gradient(180deg in oklch shorter hue, #1f4757 0%, #063241 100%)`

## Tonal ramp

- CSS: `linear-gradient(135deg in oklch shorter hue, #4f7788 0%, #1c4454 50%, #001625 100%)`
- Tailwind: `bg-linear-to-br/oklch from-[#4f7788] via-[#1c4454] to-[#001625]`
- Contrast (worst point): white 4.85:1 AA · black 1.14:1 fail · banding high
- Maker: https://brandsweets.com/gradients/new/v1.4f7788-1c4454-001625?a=135&in=oklch&hue=shorter

## Analogous

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

- CSS: `linear-gradient(135deg in oklab, #1c4454 0%, #1d4647 100%)`
- Tailwind: `bg-linear-to-br/oklab from-[#1c4454] to-[#1d4647]`
- Contrast (worst point): white 10.35:1 AA · black 2.00:1 fail · banding high
- Maker: https://brandsweets.com/gradients/new/v1.1c4454-1d4647?a=135

## Complementary

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

- CSS: `linear-gradient(135deg in oklch shorter hue, #1c4454 0%, #5e3119 100%)`
- Tailwind: `bg-linear-to-br/oklch from-[#1c4454] to-[#5e3119]`
- Contrast (worst point): white 10.23:1 AA · black 1.92:1 fail · banding high
- Maker: https://brandsweets.com/gradients/new/v1.1c4454-5e3119?a=135&in=oklch&hue=shorter

## Triadic

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

- CSS: `linear-gradient(135deg in oklab, #1c4454 0%, #661e4a 100%)`
- Tailwind: `bg-linear-to-br/oklab from-[#1c4454] to-[#661e4a]`
- Contrast (worst point): white 10.43:1 AA · black 1.85:1 fail · banding high
- Maker: https://brandsweets.com/gradients/new/v1.1c4454-661e4a?a=135

## CSS custom properties (brand.css)

```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;
}
```

## Gradient maker

Every maker URL is the gradient's state: `/gradients/new/v1.<hex>-<hex>[_pos]?a=135&in=oklch&hue=shorter&e=soft&g=8`. Hand one to a human, let them refine, and read the link they return.

## Connect an agent

Point any MCP client at the BrandSweets gradients endpoint for the same engine and corpus:

- Endpoint: https://mcp.brandsweets.com/gradients/mcp
- Tools: `make_gradient` (2–5 colours → CSS with the interpolation space, Tailwind v4, SVG, PNG URL, DTCG token + the contrast/banding/gamut report), `brand_gradients` (brand slug or palette → brand gradient, hero, button, variants).
- Resource: `gradients://corpus` — the whole bundled corpus as JSON.
