Perfect Dark to Purple Patch Gradient
CSS
background: linear-gradient(90deg, #313390 0%, #5c2e88 100%);
From Perfect Dark (#313390) to Purple Patch (#5C2E88). The two hues are 32° apart on the color wheel, close enough that the blend stays clean without a muddy middle.
Colors along the gradient
| Name | HEX | RGB | HSL | CMYK | |
|---|---|---|---|---|---|
| Perfect Dark | #313390 | 49, 51, 144 | 239°, 49%, 38% | 66, 65, 0, 44 | |
| 25% (near Majestic Eggplant) | #3C328E | 60, 50, 142 | 247°, 48%, 38% | 58, 65, 0, 44 | |
| 50% (near Majestic Eggplant) | #47318C | 71, 49, 140 | 255°, 48%, 37% | 49, 65, 0, 45 | |
| 75% (near Night Fever) | #512F8A | 81, 47, 138 | 262°, 49%, 36% | 41, 66, 0, 46 | |
| Purple Patch | #5C2E88 | 92, 46, 136 | 271°, 49%, 36% | 32, 66, 0, 47 |
Halfway along, the gradient is #47318C, closest to the named color Majestic Eggplant. The stops are mixed in RGB, the way browsers draw a linear gradient by default.
Text on this gradient
White text reads best on both ends, so one text color works across the whole gradient. The two end colors have a contrast ratio of 1.10:1, so the change is gentle.
Other ways to use it
- Top to bottom:
linear-gradient(180deg, #313390, #5c2e88) - Diagonal:
linear-gradient(135deg, #313390, #5c2e88) - Radial, from the center out:
radial-gradient(circle, #313390, #5c2e88) - Tailwind CSS:
bg-gradient-to-r from-[#313390] to-[#5c2e88]
Gradients like this work well for page headers, buttons, cards and slide backgrounds. Keep body text on a solid color for the best readability.
Related gradients
Questions
What are the HEX codes of the Perfect Dark to Purple Patch gradient?
It starts at #313390 (Perfect Dark) and ends at #5C2E88 (Purple Patch), with #47318C in the middle.
How do I reverse the gradient?
Swap the two colors or change the angle from 90deg to 270deg: linear-gradient(270deg, #313390, #5c2e88) runs from Purple Patch on the left to Perfect Dark on the right.