Palette maker

Blue to Purple Gradient: Colors, Hex Codes and CSS

A blue to purple gradient fades from a clear sky blue like into a rich violet like , usually through an indigo bridge such as so the middle stays vivid. The CSS for it is linear-gradient(135deg, #2196F3, #5C4DDB, #9C27B0).

Type
135°
 

More blue to purple gradients to try

On this page
  1. Color codes
  2. Dull middle
  3. CSS code
  4. Angles
  5. Nearby shades
  6. Contrast
  7. UI and brands
  8. Print and decor
  9. Palettes
  10. Pairings
  11. FAQ

I have built this fade into onboarding screens, brand headers and a few printed covers, and it rewards a little care. The gradient studio above lets you move the stops, change the angle and switch between linear, radial and conic, then copy the CSS. Below you will find the exact codes, the reason the middle often goes grey, and the practical limits for text, print and interiors.

Blue, Indigo and Purple: Exact Hex, RGB, HSL and CMYK

The gradient rests on two familiar colors and a bridge between them. Blue and purple are both Material Design 500 swatches, so they sit comfortably in many UI kits. Indigo is the bridge, tuned so its hue lands close to halfway between the two.

Color HEX RGB HSL CMYK (approx.)
Blue 33, 150, 243 207°, 90%, 54% 86, 38, 0, 5
Indigo 92, 77, 219 246°, 66%, 58% 58, 65, 0, 14
Purple 156, 39, 176 291°, 64%, 42% 11, 78, 0, 31

Hue is the most useful column. Blue sits at 207 degrees on the color wheel, purple at 291, and indigo at 246. The CMYK numbers are plain mathematical conversions, good as a starting point but not what a press will actually lay down (more on that in the print section).

Why the Middle of a Blue to Purple Fade Goes Dull

Mix blue and purple in plain sRGB and the halfway point is . It is a pleasant periwinkle, but its saturation is about 56%, against 66% for the indigo bridge. The eye reads that dip as a slightly grey, tired band between two bright ends.

The fix in one line

Add an indigo stop at 50%, or ask the browser to blend in oklch instead of sRGB. Either way the middle stays as lively as the ends.

Your blue to purple fade looks grey in the middle. What is the quickest fix?

A saturated bridge color replaces the washed-out midpoint that plain sRGB mixing creates.

Hue travel matters too. Going from 207 to 291 degrees passes through indigo and violet, exactly the colors people expect to see. A fade that skips them, such as blue straight to magenta, feels abrupt. When a gradient looks flat, check the middle before you touch the ends.

Two jerseys faded from blue to purple, comparing a duller straight blend middle with a vivid indigo bridge
A straight blend dips to 56% saturation in the middle; an indigo stop keeps it at 66%.

Blue to Purple Gradient CSS You Can Paste

Every current browser reads the standard linear-gradient function without prefixes. Start with the three-stop version and keep a solid color above it as a fallback.

Linear with an indigo bridge

.hero {
  background: #5C4DDB;
  background: linear-gradient(135deg, #2196F3 0%, #5C4DDB 50%, #9C27B0 100%);
}

Blending in oklch

CSS lets you choose the color space used for mixing. Current Chrome, Safari, Firefox and Edge support it, and older browsers ignore the line and use the one before it.

.hero {
  background: linear-gradient(135deg, #2196F3, #9C27B0);
  background: linear-gradient(in oklch 135deg, #2196F3, #9C27B0);
}

Radial and conic

Radial gradients suit a glow behind a hero image. A conic gradient that repeats the first color at the end loops without a visible seam.

.glow { background: radial-gradient(circle at 20% 20%, #2196F3, #5C4DDB 45%, #9C27B0); }
.ring { background: conic-gradient(from 180deg, #2196F3, #9C27B0, #2196F3); }

Which Angle and Gradient Type Works Best

135deg runs from top left to bottom right and is the angle I reach for first. It feels like light falling across a surface, and it works on cards, buttons and full pages. 90deg gives a clean left to right band for progress bars and thin dividers, while 180deg runs top to bottom and reads calmly behind long text.

Stop position matters as much as direction. Put the indigo stop at 40% to give blue more room, or at 60% for a more purple page. On wide screens, soft two-hue fades can show faint stripes called banding, and a subtle noise texture or an extra stop usually hides them.

Try this: Set the angle to 135 degrees in the studio, then drag the indigo stop from 30% to 70%. Stop where the middle looks brightest and write that percentage into your design notes.

Nearby Shades: Indigo, Violet, Periwinkle and Friends

Blue to purple covers a wide stretch of the wheel, and many named colors live inside it. Knowing them helps you pick end stops that match your brand instead of defaulting to ours.

  • Royal blue : a deeper, more formal start.
  • Slate blue : soft and slightly grey, a gentle middle.
  • Blue violet : punchy and electric, almost screen-only.
  • Rebecca purple : calm and deep, good behind white text.
  • CSS indigo : much darker than the bridge used here.
  • Periwinkle : pale and airy for soft backgrounds.

Slide the blue end toward green and you reach teal gradient territory. Push the purple end toward warmth and it becomes a pink to purple gradient, or with more heat a red to purple gradient.

Can You Put Text on It? Contrast and WCAG Ratios

White text on the blue end, , scores about 3.1:1. That misses the 4.5:1 WCAG AA target for normal text and only just clears the 3:1 bar for large text. White on indigo scores about 5.9:1, and on purple about 6.3:1, so the risk sits entirely at the blue end.

White text on #2196F3 scores about 3.1:1. What does that mean for body copy?

Normal text needs 4.5:1 for AA, while large text only needs 3:1.

On a client’s mobile banner, the headline sat over the blue corner and failed an accessibility audit. Darkening the start to lifted white text to about 4.6:1 without changing the feel. Black text on reaches about 6.7:1, so dark text is the other route for lighter versions.

.hero--accessible {
  color: #fff;
  background: linear-gradient(135deg, #1976D2 0%, #5C4DDB 50%, #9C27B0 100%);
}

Every stop in that version clears 4.5:1 against white. If you must keep the bright blue, place text over the purple half or add a semi-transparent dark layer behind it.

Using Blue to Purple in Apps, Brands and Dark Mode

Blue to purple suits tech, finance, music, gaming and wellness products. Blue brings calm and familiarity, and purple adds a creative, slightly premium note. Use the gradient on hero sections, onboarding screens, progress rings and a primary button, and keep reading areas flat so the gradient stays special.

For dark mode, move to deeper stops such as , and rather than laying black over the bright version, which turns the hues muddy. Gradient headlines also work well, as long as both ends hold up on the page color. On white, reaches about 4.6:1 and about 6.3:1.

.title {
  background: linear-gradient(90deg, #1976D2, #9C27B0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

Screens emit light and ink absorbs it, so a glowing never prints exactly as it appears. On one brochure proof, the blue came out flatter and the purple drifted toward plum. Since then I ask for a printed proof and, for logos, consider a spot color for the blue.

Beyond the press, the fade travels well:

  • Interiors: a true painted ombré is hard to do, so most people use wallpaper, a mural or colored lighting. Deep indigo with violet accents suits bedrooms and media rooms.
  • Fashion: dip-dye and ombré on satin, tulle and knitwear all work, with the darker tone at the hem.
  • Art: in watercolor, wet blue into wet violet and let the pigments meet on the paper.

The pairing has a long pedigree. Ultramarine was once ground from lapis lazuli and Tyrian purple came from sea snails, so both colors were once luxury goods.

Blue to Purple Palettes to Copy

Each palette below starts from the same blue to purple core and shifts depth and lightness for a different job. Copy the hex codes into Figma, Tailwind or CSS variables.

Midnight Violet

Dark dashboards, music apps and night mode screens with glowing accents.

Horizontal bar split 60/30/10 into periwinkle, indigo and purple with hex codes, plus an app screen using the same split
Give a blue to purple palette a light 60% base, 30% indigo and a 10% purple accent.
Daylight Indigo

Product pages and SaaS sites that need a bright, friendly gradient.

Soft Periwinkle

Wellness brands, invitations and calm backgrounds with one dark text color.

Electric Night

Gaming, events and posters where saturated color is the whole point.

A simple rule keeps them usable: give the lightest color to backgrounds, the darkest to text, and let the two saturated middle colors carry buttons and highlights.

Colors That Pair Well With Blue to Purple

Neutrals are the safest partners. Soft grays and off-whites let the gradient lead, and a gray gradient can act as a quiet backdrop on the same page. For energy, orange sits opposite blue, and the orange to blue gradient shows how that contrast behaves.

A thin line of gold over the indigo end feels luxurious on invitations and packaging. For a softer mood, fade the purple end into pastel purple, which also gives text a lighter surface to sit on.

The colors behind these gradients

Blue to Purple Gradient: questions people ask

What colors make a blue to purple gradient?

A reliable trio is blue #2196F3, indigo #5C4DDB and purple #9C27B0. The indigo in the middle keeps the blend bright instead of grey. For a two-color version, use #2196F3 and #9C27B0 directly.

What is the CSS code for a blue to purple gradient?

Use background: linear-gradient(135deg, #2196F3 0%, #5C4DDB 50%, #9C27B0 100%); on any element. Put a solid background color on the line above it as a fallback.

How do I reverse a blue to purple gradient?

Swap the order of the stops so purple comes first, or add 180 degrees to the angle. Changing 135deg to 315deg flips the direction without touching the colors.

Is white text readable on a blue to purple gradient?

Only if the blue end is dark enough. White on #2196F3 reaches about 3.1:1, which fails AA for body text, while white on #1976D2 reaches about 4.6:1 and passes.

Why does my blue to purple gradient look muddy or grey?

Mixing the two ends in plain sRGB produces a duller midpoint, around #5F5FD2. Add an indigo stop such as #5C4DDB, or blend in oklch with linear-gradient(in oklch 135deg, ...).

Keep exploring