Photo in the color Medium jungle green
Pictured: Medium jungle green, the closest color we have a photo of (#1C352D)
rgb(42, 34, 67)
#2A2243

Midnight Velvet #2A2243 RGB Color Code

Name from the community color list.

Midnight Velvet (#2A2243) is a muted, dark purple. In RGB it is made of 16% red, 13% green and 26% blue (R 42, G 34, B 67). The blue channel is the strongest. In HSL it has a hue of 255°, 33% saturation and 20% lightness. Its relative luminance is 0.020, so white text is easier to read on top of it. For print, a rough CMYK match is 37% cyan, 49% magenta, 0% yellow and 74% black. Check it against your printer's ICC profile before you print. It is a cool color. It goes well with warm oranges and reds for contrast. For a calm, matching look, use nearby cool tones.

Open in color picker

Midnight Velvet color codes

#2A2243 in every common color format. Click a value to copy it.

FormatValueNotesCopy
HEX #2A2243 Valid CSS
RGB rgb(42, 34, 67) Valid CSS
HSL hsl(255, 33%, 20%) Valid CSS
HSV / HSB hsv(255, 49%, 26%) Not a CSS format
HWB hwb(255 13% 74%) Valid CSS
CMYK cmyk(37%, 49%, 0%, 74%) Approximate (no ICC profile)
OKLCH oklch(27.84% 0.0599 293.27) Valid CSS
OKLab oklab(27.84% 0.0237 -0.055) Valid CSS
CIELAB lab(15.5% 10.8 -19.79) D50, as in CSS
CIELCH lch(15.5% 22.54 298.62) Valid CSS
Display P3 color(display-p3 0.1596 0.1345 0.2544) Valid CSS
XYZ (D65) color(xyz-d65 0.0254 0.0204 0.0557) Valid CSS
Decimal 2761283 Integer (0xRRGGBB)

CMYK here is a rough screen match without an ICC profile. See CMYK and print. Relative luminance: 0.0204. Nearest web-safe color: #333333.

Mix Midnight Velvet with other colors

See what #2A2243 makes with red paint, under a green light, printed with cyan ink and in a digital blend with blue. Click a picture to change the colors and amounts in the color mixer.

Use Midnight Velvet in your code

Ready to paste into CSS, Sass, Tailwind, iOS, Android and Flutter. Click the icon to copy a line.

WhereCodeCopy
CSS variable--midnight-velvet: #2A2243;
Sass variable$midnight-velvet: #2A2243;
Tailwind CSS v4@theme { --color-midnight-velvet: #2A2243; }
Tailwind CSS v3 configcolors: { 'midnight-velvet': '#2A2243' }
SwiftUIColor(red: 0.165, green: 0.133, blue: 0.263)
UIKitUIColor(red: 0.165, green: 0.133, blue: 0.263, alpha: 1)
Android XML<color name="midnight_velvet">#FF2A2243</color>
Flutter and Jetpack ComposeColor(0xFF2A2243)

Accessibility and contrast

White text works best on #2A2243 (14.91:1, AAA). Here is how #2A2243 does as a text color:

Large heading text
Body text at 16px. The quick brown fox jumps over the lazy dog.
14.91:1 on white
APCA Lc 102
AAA
Large heading text
Body text at 16px. The quick brown fox jumps over the lazy dog.
1.41:1 on black
APCA Lc 0
Fails AATry #776F96

Check this color against any background in the contrast checker. WCAG ratios and APCA Lc values measure different things, so one can't stand in for the other. Learn more.

How people with color blindness see Midnight Velvet

#2A2243 next to its complement and its two triadic colors, as seen with each type of color blindness.

  • Normal visionhow most people see it
  • Protanopiano red cones, about 1% of men
  • Deuteranopiano green cones, the most common type
  • Tritanopiano blue cones, very rare
  • Achromatopsiano color at all, very rare

#2A2243 stays easy to tell apart from its complement and triadic colors for the common types of color blindness. Try your own colors in the color blindness simulator.

Midnight Velvet in a user interface

A sample app screen with #2A2243 as the main color, on a light and a dark theme.

Light theme

Dark theme

Buttons and bars use #2A2243 as it is. On the dark theme, #2A2243 is too hard to read as text (1.19:1), so links, the badge and outline text use #837BA3 there (4.50:1). Build a full color scheme around it in the UI color preview.

Color harmonies for Midnight Velvet

These schemes turn the hue of #2A2243 around the color wheel. Each swatch links to its own page.

Complementary

Two colors on opposite sides of the wheel. This gives the most contrast.

Open palette

Analogous

Hues that sit next to each other and look good together.

Open palette

Triadic

Three hues spaced evenly around the wheel. Bold, but still balanced.

Open palette

Split complementary

A base color plus the two hues on each side of its opposite. Strong contrast that clashes less.

Open palette

Tetradic (rectangle)

Two pairs of opposite colors. Let one color lead and use the others less.

Open palette

Square

Four hues 90° apart, spread evenly around the wheel.

Open palette

Monochromatic

One hue at different levels of lightness and saturation.

Open palette

Gradients with Midnight Velvet

Four CSS gradients made from #2A2243. Copy the code, or open one in the gradient generator to change it.

Soft tint

From a pale tint to the full color.

background: linear-gradient(90deg, #D0CED7, #2A2243);

Edit in the gradient generator

Deep shade

The color fading into a dark shade.

background: linear-gradient(180deg, #2A2243, #05030C);

Edit in the gradient generator

Analogous

Its two neighbors on the color wheel.

background: linear-gradient(135deg, #222B43, #2A2243, #3B2243);

Edit in the gradient generator

Triadic

A bold blend with a triadic color, through a clean middle.

background: linear-gradient(135deg, #2A2243, #362734, #432A22);

Edit in the gradient generator

Shades, tints and tones of Midnight Velvet

Shades are darker, tints are lighter and tones are grayer. We make them in OKLCH so the steps look even. Hover a step to see its code, or click it to open it.

Design system scale (50 to 950)

Midnight Velvet sits at step 900. Export the full scale as CSS variables or Tailwind tokens from the picker.

  1. 50
    F7F5FF
  2. 100
    EDEAFE
  3. 200
    DBD7F2
  4. 300
    C2BCDE
  5. 400
    A49DC4
  6. 500
    8780A7
  7. 600
    6D668B
  8. 700
    565071
  9. 800
    433E5A
  10. 900
    2A2243
  11. 950
    1D1B26

Closest RAL, Tailwind and CSS colors

The nearest match to #2A2243 in three color systems that designers and builders use.

ΔE is the distance in OKLab: under 2 is hard to see, over 10 is a clearly different color. Browse all RAL colors, the Tailwind palette or the 148 CSS color names. RAL values on screens are only a guide, so check a real color chart before you order paint.

The named colors that look closest to this one (ΔE in OKLab). Browse all shades of purple or search the color library.