CssShift logo CssShift — CSS Gradient Studio

Violet to Pink Gradient — CSS, Hex and Angles

Candy and iris; softer than purple to pink, so it survives small text better. The pair is #8B5CF6 → #EC4899, and on a 135° axis it reads as a diagonal wash. Everything below is generated from those two values, so the CSS you copy is exactly what the previews render.

0° · bottom to top
45°
135° · default
90° · left to right
radial
conic

Copy the CSS

CSS
.gradient {
  background: #8B5CF6; /* fallback for old browsers */
  background: -webkit-linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
  background: -moz-linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
  background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
}
CSS-in-JS
const gradientStyle = {
  background: '#8B5CF6', // fallback
  backgroundImage: 'linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%)',
};

The two endpoints

NameHexRGBHSLvs whitevs black
Violet#8B5CF6rgb(139, 92, 246)hsl(258, 90%, 66%)4.23:14.96:1
Pink#EC4899rgb(236, 72, 153)hsl(330, 81%, 60%)3.53:15.95:1

The midpoint is #bc52c8 (rgb(188, 82, 200), saturation 51%). Close to the 85% the two ends average, so the transition stays saturated throughout.

What each angle does

AngleDirectionFunction value
0°bottom → toplinear-gradient(0deg, #8B5CF6 0%, #EC4899 100%)
45°bottom-left → top-rightlinear-gradient(45deg, #8B5CF6 0%, #EC4899 100%)
90°left → rightlinear-gradient(90deg, #8B5CF6 0%, #EC4899 100%)
135°top-left → bottom-rightlinear-gradient(135deg, #8B5CF6 0%, #EC4899 100%)
180°top → bottomlinear-gradient(180deg, #8B5CF6 0%, #EC4899 100%)
225°top-right → bottom-leftlinear-gradient(225deg, #8B5CF6 0%, #EC4899 100%)
270°right → leftlinear-gradient(270deg, #8B5CF6 0%, #EC4899 100%)
315°bottom-right → top-leftlinear-gradient(315deg, #8B5CF6 0%, #EC4899 100%)

The same pair as linear, radial and conic

TypeFunction value
linearlinear-gradient(135deg, #8B5CF6 0%, #EC4899 100%)
radialradial-gradient(circle at 50% 50%, #8B5CF6 0%, #EC4899 100%)
conicconic-gradient(from 0deg at 50% 50%, #8B5CF6 0%, #EC4899 100%)

Frequently asked

What is the CSS for a violet to pink gradient?
background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%); — #8B5CF6 at 0% and #EC4899 at 100%, on a 135° axis. Swap 135deg for to right if you want the direction to follow the element ratio instead of a fixed angle.

Does it need vendor prefixes?
Not for current browsers. Unprefixed linear-gradient has been supported everywhere for years, and the -webkit- / -moz- lines only matter for stacks that still ship to browsers older than 2013. The generator emits both, plus a solid #8B5CF6 fallback.

Why would the middle look muddy?
This pair does not: both ends are close enough in hue that a straight sRGB blend stays clean, with mid #bc52c8 holding 51% saturation against 85% at the ends.

Can I put text straight onto it?
Check both ends, not the average. White text clears 4.5:1 against neither end and black text clears it against the violet end. Measured ratios: Violet is 4.23:1 on white and 4.96:1 on black; Pink is 3.53:1 on white and 5.95:1 on black.

Related gradients