Palette maker

Sunset Gradient: Colors, Backgrounds and CSS Codes

A sunset gradient blends golden yellow , orange and pink purple , with light at one end and dusk at the other. The CSS is linear-gradient(135deg, #FFC837, #FF7E40, #B83B8F).

Type
135°
 

More sunset gradients to try

On this page
  1. Colors
  2. Color codes
  3. CSS code
  4. Smooth blends
  5. Web and apps
  6. Contrast
  7. Palettes
  8. Print
  9. Interiors and art
  10. Related gradients
  11. FAQ

Use the gradient studio above to move the stops, change the angle or switch to a radial version, then copy the finished code. Below you will find exact color values, ready-made CSS, contrast ratios I calculated for text, and notes on print, interiors and fashion.

What colors make a sunset gradient?

When the sun sits low, its light travels through more air and the blue end of the spectrum scatters away. What reaches your eye is yellow, orange and red near the horizon, with pink and purple higher in the sky. A good sunset gradient copies that order: a bright golden yellow for the glow, a warm orange for the middle and a pink purple for the dusk.

The three stops here also travel around the color wheel in one direction, from a hue of about 44 degrees (yellow) to 19 (orange) and then 320 (magenta purple). Their relative luminance falls steadily too, from about 0.63 to 0.37 to 0.15 on the WCAG scale. That steady drop is why the blend reads as fading light rather than three colors sitting side by side. For a night ending, add a fourth stop of deep indigo such as .

Sunset gradient hex, RGB, HSL and CMYK values

I worked these out directly from the hex codes. The CMYK column uses the plain mathematical conversion, so treat it as a starting point rather than a press recipe.

Stop HEX RGB HSL CMYK
Golden Yellow 255, 200, 55 44, 100%, 61% 0, 22, 78, 0
Orange 255, 126, 64 19, 100%, 63% 0, 51, 75, 0
Pink Purple 184, 59, 143 320, 51%, 48% 0, 68, 22, 28

Close colors help you place these. The orange is a near neighbor of CSS coral () but carries less blue, so it feels hotter and less pink. Next to CSS orange () it is redder and softer, and the golden yellow is warmer than CSS gold (). The pink purple sits between berry and orchid: far less saturated than magenta () and calmer than medium violet red ().

Sunset gradient CSS code you can copy

Linear sunset

The classic build is a three stop linear gradient, and the angle decides where the light sits. 0deg runs bottom to top, so golden yellow lands at the bottom like a horizon. 90deg runs left to right, and 135deg gives the diagonal that suits cards and hero panels.

Which angle puts golden yellow at the bottom, like a horizon?

0deg draws the gradient from the bottom edge upward, so the first stop sits at the bottom.

.sunset {
  background: #FF7E40; /* fallback */
  background: linear-gradient(135deg, #FFC837 0%, #FF7E40 50%, #B83B8F 100%);
}

Radial sun on the horizon

For a sun glowing at the bottom edge, use a radial gradient and anchor its center there. Pushing orange to 35% keeps the gold glow compact and gives the purple room to spread across the sky.

.horizon {
  background: radial-gradient(circle at 50% 100%, #FFC837 0%, #FF7E40 35%, #B83B8F 80%);
}

How to keep a sunset gradient smooth, not muddy

Gradients can look dull in the middle when two colors blend in plain sRGB. Modern CSS lets you choose the interpolation space, and linear-gradient(in oklch 135deg, #FFC837, #FF7E40, #B83B8F) usually keeps the middle brighter and more even. Current versions of the major browsers support it, but always write a plain declaration first as a fallback.

Hue wheel showing orange to blue blending through grey versus passing via pink purple, with two gradient bars
Blue and orange blend through grey, so route the sunset through pink purple instead.

The warm stops in this gradient behave well either way, because orange and pink purple are neighbors on the wheel. Trouble starts when you push a sunset toward a blue sky, since orange and blue blend through grey. Put a pink or purple stop between them instead of jumping straight across. A few habits help:

  • Add a fourth stop rather than stretching three stops across a very large surface.
  • Place stops unevenly, for example 0%, 40% and 100%, to give the glow more room.
  • Interpolate in oklab or oklch, and keep an sRGB fallback line.
  • Lay a faint noise texture at low opacity over big areas to hide banding.

Using a sunset gradient in web and app design

A sunset gradient suits large, calm surfaces: hero sections, onboarding screens, story backgrounds, music and wellness app headers, and empty states. Keep it to one gradient per screen and let the rest of the interface stay quiet. A flat orange like works as a single accent for a toggle or icon, which keeps the gradient feeling special.

Bar split 60, 30 and 10 into quiet neutral, sunset gradient and orange accent, with a matching app screen
Let a quiet 60 percent surround one 30 percent sunset gradient and a 10 percent orange accent.

In dark mode, lower the gradient’s opacity over a deep neutral such as a dark grey so it glows instead of glaring. Gradient filled buttons are fine, but check the label against every stop it crosses, not only the middle.

Put the light low

A sunset looks natural when golden yellow sits at the bottom and purple sits high. Use 0deg for scenes and 135deg for general panels.

Is text readable on a sunset gradient?

Contrast is where sunset gradients most often fail, because one background holds three very different brightnesses. I calculated WCAG 2 ratios for each stop. Black text scores 13.57:1 on golden yellow and 8.31:1 on orange. White text scores 5.17:1 on pink purple, but only 2.53:1 on orange and 1.55:1 on golden yellow. Here is where text belongs:

  • On the golden and orange half, use near black or a deep plum.
  • On the pink purple half, use white.
  • At the blended midpoint, roughly , white gives 3.62:1 (large text and icons only) and black gives 5.81:1.

The middle is the trap. Neither color looks obviously wrong there, yet white body text sits below the 4.5:1 AA line. On a wellness app hero I once had a white headline crossing the orange stop at about 2.5:1. I left the brand colors alone and rotated the gradient so the headline sat over the pink purple, which fixed it.

Try this: Paste your headline color into a contrast checker against , and , note the three ratios, then move the headline until the worst spot behind it clears 4.5:1.

Which text color passes AA for body text on orange #FF7E40?

Black measures 8.31:1 on that orange, while white only reaches 2.53:1.

Sunset gradient palettes and variations to copy

Once the main trio is set, small changes give you a different time of day. Lift the lightness and you get a peach dusk, close to a light pink at the top. Add indigo and you get late twilight. Warm the purple toward rust and it becomes a desert sunset, which pairs well with the tones in a brown gradient.

Golden Hour

Hero banners and app onboarding where the main gradient needs a cream and indigo anchor.

Beach Dusk

Event posters and social stories that need a softer, pinker evening sky.

Desert Sunset

Packaging, interiors and ceramics with earthy terracotta tones instead of bright pink.

Peach Lilac

Wellness brands, wedding stationery and gentle sunrise style backgrounds.

The palettes below follow one logic: a light stop, a warm middle, a dusk color and a dark anchor for type or backgrounds. Each has five hex codes, so you can use them as gradients or as flat swatches.

Printing a sunset gradient: CMYK, paper and branding

Gradients print differently from the way they glow on screen. Golden yellow converts cleanly to about 22% magenta and 78% yellow, and orange is a mix of the same two inks. On one packaging proof the orange came back flatter than my screen suggested, while the pink purple held up better than I feared. Screens simply push saturated warm colors further than ink can.

Ask for a proof on the real paper, since uncoated stock dulls orange the most. Keep print gradients long and gentle so banding stays invisible. In branding, use the sunset gradient as a supporting background behind a simple logo, and supply a flat version of the brand color ( here) for stamps, embossing and small labels.

Sunset gradients in interiors, fashion and art

In interiors, a sunset gradient shows up as an ombre wall, a sheer curtain or just a colorway: golden yellow in lamp light and brass, orange in terracotta, pink purple in a velvet cushion. Keep the warm tones broad and the purple to one piece, so a room feels like evening rather than a stage set. For metallic touches, the gold gradient page shows how brass and foil effects are built.

In fashion, the same blend is the classic dip-dye: gold at the hem, fading up through orange into pink purple. Silk and jersey give the softest fade, while printed fabric lets you control it exactly. In painting, work wet on wet in watercolor with yellow at the bottom of the sheet, or glaze acrylics in thin layers, letting each warm layer dry before the next.

A sunrise uses the same colors in reverse, so the CSS is identical with the order flipped. The difference is mood: I push sunrise toward pale yellow, peach and lilac, and sunset toward deeper orange and purple. Golden hour is just the first stop and a half, yellow melting into orange, and a two color version is close to a pink to yellow gradient once you shift the pink toward orange.

If you want the dusk end to dominate, the purple gradient page has richer violets to take over after the pink. And if you want every hue rather than only the warm half, the rainbow gradient is the full spectrum cousin of a sunset.

The colors behind these gradients

Sunset Gradient: questions people ask

What is the hex code for a sunset gradient?

There is no single code, but a reliable three stop version uses #FFC837, #FF7E40 and #B83B8F. Golden yellow supplies the glow, orange the middle and pink purple the dusk sky.

What colors are in a sunset gradient?

Typically yellow or gold, orange, coral or pink, and purple, in that order from the horizon upward. Many designers add a deep indigo as a last stop to suggest the first minutes of night.

How do I make a sunset gradient in CSS?

Use linear-gradient with three stops, for example linear-gradient(135deg, #FFC837, #FF7E40, #B83B8F). Add a flat background color above it as a fallback, and try the in oklch keyword for smoother blending.

What is the best angle for a sunset gradient?

Use 0deg when you want a scene, because golden yellow then sits at the bottom like the horizon. For cards, buttons and general panels, 135deg gives a pleasing diagonal.

Is white text readable on a sunset gradient?

Only on the dark end. White on pink purple #B83B8F measures 5.17:1, but on orange #FF7E40 it is just 2.53:1 and on golden yellow #FFC837 it is 1.55:1, so use dark text on the warm half.

Keep exploring