The studio above lets you move the stops, change the angle, switch between linear, radial and conic, and copy the finished CSS. I’m Calder Wynne, and after twelve years of building color systems for apps, brands and print, this is one of the gradients I reach for when a design needs depth without noise. Below you will find the exact codes, the CSS, contrast numbers worked out from the hex values, and the traps that catch people at the printer.
What a black to purple gradient looks like
Black gives the gradient its depth and purple gives it a pulse. is the floor of the screen, is an ink-like violet that leans slightly toward blue, and is a clear, saturated amethyst with plenty of red in it. Together they read as night sky, velvet, stage light or neon after dark.
Direction changes the mood. At 135deg the black starts top left and the purple glows from the bottom right like a distant light. At 180deg the black sits on top and the purple pools at the bottom, which is how many hero sections and phone wallpapers are built. If you want the purple pushed cooler, the blue gradient page shows how far that shift can go.
Hex, RGB, HSL and CMYK for each stop
These values are converted directly from the three hex codes, so you can paste them into any tool.
| Color | HEX | RGB | HSL | CMYK |
|---|---|---|---|---|
| Black | 0, 0, 0 | 0°, 0%, 0% | 0, 0, 0, 100 | |
| Dark Purple | 46, 8, 84 | 270°, 83%, 18% | 45, 90, 0, 67 | |
| Purple | 123, 47, 190 | 272°, 60%, 46% | 35, 75, 0, 25 |
The two purples sit at almost the same hue (270 and 272 degrees). Only lightness and saturation change, which is why the gradient feels like one color deepening instead of two colors competing. In CSS you can also write the bright stop as hsl(272 60% 46%). The CMYK figures are the plain mathematical conversion, and a real press profile will give different numbers, as the print section explains.
CSS for linear, radial and conic versions
Linear
Three stops with the dark purple in the middle give the smoothest fade. Keep a flat fallback color for very old browsers.
.hero {
background: #2E0854;
background: linear-gradient(135deg, #000000 0%, #2E0854 50%, #7B2FBE 100%);
}
Radial glow
A radial version works as a spotlight. Place the bright purple off center so it reads as a light source and not a bullseye.
.card {
background: radial-gradient(circle at 70% 20%, #7B2FBE 0%, #2E0854 35%, #000000 75%);
}
Conic sweep
Conic gradients rotate around a center point, which suits glowing borders and loading rings. Repeat the first color at the end so there is no hard seam.
.ring {
background: conic-gradient(from 200deg, #000000, #2E0854, #7B2FBE, #2E0854, #000000);
}
Why dark gradients band, and how to smooth them
Black to purple is one of the safer gradients for color mixing, because both ends share a hue and the middle never turns gray or brown. The real weakness is banding. Screens use 256 levels per channel, and the eye notices small jumps in the darkest range, so a wide fade from toward can show faint stripes on large or high-contrast displays.
The fixes are cheap and worth building in from the start:
- Lay a faint grain or noise overlay over the gradient at a few percent opacity to break up the steps.
- Avoid stretching a tiny color change across a huge area. Red moves only from 0 to 46 between and .
- Try interpolating in oklch, for example
linear-gradient(in oklch 135deg, #000000, #2E0854, #7B2FBE), and keep a normal declaration above it as a fallback. - Export wallpapers and social images as PNG, because heavy JPEG compression makes bands more visible.
Dark purple vs indigo, violet and plum
Several named colors sit close to our stops, and mixing them up changes the feel. CSS indigo is , a touch lighter than . CSS purple is , which leans toward magenta at a hue of 300 degrees, while sits at 272 and looks bluer and more electric. Rebeccapurple, , is the closest named relative of the bright stop but a little duller.
In plain sRGB, the midpoint between and is , so the middle of a two-stop fade is much darker than most people expect.

Violet () and plum () are pastel and pink-leaning, so they belong on top of the gradient as highlights, not inside it. If you want the dark end to feel cold and navy instead of violet, the dark blue gradient page covers that neighbor.
Text contrast on black and purple (WCAG)
I computed these ratios from the hex codes using the WCAG formula. White () on gives about 16.4:1, and white on gives 7.02:1. That clears the 4.5:1 AA threshold for normal text across the whole gradient, and even reaches the 7:1 AAA mark at the brightest stop, though only just.
On a gradient running from #000000 to #7B2FBE, which text color passes WCAG AA everywhere?
White measures 7.02:1 against the brightest stop, while black text on #7B2FBE manages only 2.99:1.
Going the other way fails quickly. Black text on measures 2.99:1, and purple used as text on a background also lands at 2.99:1, just under the 3:1 needed for large text and UI components. On a dashboard project, a purple footer link looked fine on my monitor and failed the check, so I lifted it to , which gives about 4.6:1 on black and kept the brand feel intact.
.hero h1 { color: #FFFFFF; }
.hero a { color: #9D4EDD; } /* about 4.6:1 on #000000 */
Using the gradient in websites and apps
The gradient works best as a surface behind confident, white typography. Keep the brightest purple away from small text, and let the black end carry dense content.
- Hero sections: put the headline over the darker half and the glow behind an image or illustration.
- Dark mode surfaces: a charcoal such as #333333 lifts cards off a pure black page without losing the mood.
- Buttons: solid with a white label passes at 7.02:1, and a gradient only needs to appear on hover.
- Glows and borders:
box-shadow: 0 0 40px rgba(123, 47, 190, 0.45);gives a neon edge with no extra images.
Keep the gradient on one or two large surfaces per screen. Repeating it on every card makes the interface heavy and flattens the hierarchy.
Try this: Place a white 18px headline on your gradient, then step back from the screen and squint. Wherever the text starts to blur into the background, move the stop further away from it.
Branding, fashion, interiors and art
Purple has long carried a royal, expensive meaning, and black adds nightlife and luxury on top. That is why the pairing shows up in music, gaming, streaming, perfume and event branding. For a premium finish, add a metallic accent such as the ones on the gold gradient page, used sparingly on logos and thin rules.
In fashion, the same fade appears as ombre dye on satin and velvet, and in hair and nail colors. In interiors, a matte deep purple wall behaves like black in low light and shows its color under warm bulbs, and purple LED strips can imitate the gradient on a ceiling edge. In painting and airbrush work, mix purple into black to deepen a night sky, and use white only for final highlights.
Printing a black purple gradient without surprises
Screens emit light and paper reflects it, so a dark purple that glows on a monitor can look flat on paper. On one packaging job, a solid came back from the press proof noticeably grayer on uncoated board than on my screen. Moving to a coated stock and a richer ink build fixed it.
What is the safest step before printing a large black purple background?
Paper, ink and coating change how dark purples look, and only a proof on the actual stock shows it.
Saturated violets such as are also near the edge of what CMYK can reproduce, so expect some loss of punch. For large black areas, many printers use a rich black, which adds cyan, magenta and yellow under the black ink, and #231F20 is a common on-screen stand-in for press black. Ask your printer for their exact ink values and always request a proof on the real paper.
Palettes that pair well with black and purple
The gradient is strong enough to carry a whole layout, so the supporting colors should stay quiet or deliberately sharp. A pale lilac or off-white keeps text comfortable, while a single accent brings energy.
Dark-mode apps and music pages with white or pale lilac text.
Gaming, streaming and event graphics that need a cool electric accent.
Luxury packaging, invitations and brand marks with a warm metallic accent.
Quiet editorial layouts and interiors using softened, grayed purples.
Cool accents such as the teal on the turquoise gradient page feel electric against violet. Warm pinks and yellows, like those in the pink to yellow gradient, add a synthwave sunset feel.
The colors behind these gradients
Black Purple Gradient: questions people ask
What colors make a black and purple gradient?
The simplest version uses black #000000 and purple #7B2FBE. Adding dark purple #2E0854 in the middle makes the fade smoother and richer.
What is the CSS code for a black to purple gradient?
Use background: linear-gradient(135deg, #000000, #2E0854, #7B2FBE); for a diagonal fade. Swap the angle to 90deg for left to right or 180deg for top to bottom.
Is white text readable on a black purple gradient?
Yes. White has a contrast ratio of about 16.4:1 on #2E0854 and 7.02:1 on #7B2FBE, so it passes WCAG AA across the whole gradient. Black text does not, with only 2.99:1 on #7B2FBE.
What is the best angle for a black purple gradient?
135deg is a reliable default because it places the glow in one corner and feels natural on both wide and tall screens. Use 180deg for a dusk-horizon look and 90deg for banners.
How do I stop banding in a dark purple gradient?
Add a faint grain overlay at a few percent opacity, avoid stretching a small color change over a huge area, and export images as PNG instead of heavily compressed JPEG. Interpolating in oklch can also help in modern browsers.
Keep exploring
- Brown Gradient: Dark Brown Gradient Colors, Hex Codes and CSS
- Pastel Green Gradient: Backgrounds, Wallpapers and CSS Codes
- Black Gradient: Dark Theme Gradients with CSS Codes
- Rainbow Gradient: Colors, Backgrounds and CSS Codes
- Green Gradient: Color Combinations, Hex Codes and CSS
- Bronze Gradient: Wallpaper Colors, Hex Codes and CSS
- Honey Blonde Color: Hex Code, RGB and Palettes
- Light Green Color: Hex Code, RGB and Palettes