On this page
Below you’ll find the exact codes in every format, the WCAG numbers I calculated, softer shades that behave better in real projects, flag and brand examples, and four ready palettes. I’ll also cover the two places this pair most often goes wrong: gradients and print.
Yellow and Blue Hex, RGB, HSL and CMYK Codes
Pure yellow is : red and green at full strength, no blue. Pure blue is : only the blue channel switched on. Both sit at 100% saturation and 50% lightness in HSL, which is the most vivid version of each hue a screen can show.
| Format | Yellow | Blue |
|---|---|---|
| HEX | ||
| RGB | 255, 255, 0 | 0, 0, 255 |
| HSL | 60°, 100%, 50% | 240°, 100%, 50% |
| CMYK (basic conversion) | 0, 0, 100, 0 | 100, 100, 0, 0 |
| CSS keyword | yellow | blue |
The CMYK row is the plain mathematical conversion. Real printers convert through an ICC profile, so the numbers on your proof will differ, and I come back to that in the print section.
Why Yellow and Blue Contrast So Strongly
On the RGB wheel used by screens, yellow sits at 60° and blue at 240°, exactly 180° apart. That makes them true complements. Add the two lights together and you get white: plus equals . It is the reason the pair looks so balanced on a display.

Painters learned a different wheel. In the traditional red-yellow-blue model, blue’s partner is orange and yellow’s partner is violet, and mixing the two pigments gives green rather than white. If you want yellow against its artist’s opposite, our purple and yellow page covers that pairing. Temperature does the rest of the work here: yellow is warm and seems to advance, blue is cool and seems to recede.
Contrast Ratios and WCAG: What Actually Passes
I calculated these with the WCAG relative luminance formula. Pure yellow has a luminance of about 0.928 and pure blue about 0.072, which gives 8.0:1. That clears AA (4.5:1 for body text) and AAA (7:1), so either color can carry text on the other.
Which of these fails WCAG contrast for normal body text?
Pure yellow on white is only about 1.07:1, far below the 4.5:1 needed for body text.
The trap is pairing either color with a neutral. Here are the numbers I worked out:
- Yellow on blue: 8.0:1, passes AA and AAA
- Blue on white: 8.59:1, passes AAA
- Yellow on black: 19.56:1, passes AAA
- Blue on black: 2.44:1, fails even the 3:1 large-text bar
- Yellow on white: 1.07:1, fails
Flag-style tones are looser. The RGB values listed for Ukraine’s flag, and , come to about 4.9:1, enough for AA body text but not AAA. Because these ratios measure luminance, they hold up for people with red-green color blindness, who still separate blue from yellow easily. Rarer tritan types are the exception, so never rely on hue alone to carry meaning.
Shades That Behave Better Than Pure Yellow and Blue
Pure and are screen colors at full blast. Large areas tire the eye, and neither exists as a single ready-made ink. Most finished designs step down: gold for a warmer yellow, lemon for a friendlier one, mustard for fashion and interiors. For a deeper, antique-leaning option, look at dark gold.
On the blue side, royal blue suits buttons, cobalt suits logos that must print, and navy is the dependable color for text and headers. Azure is the brighter, sky-leaning choice when pure blue feels too violet.
Keep one color dark and one light. Deep navy with pale butter, or bright yellow with deep blue, always reads better than two mid-tones.
Yellow and Blue Flags, Teams and Brands
Ukraine’s flag is two equal horizontal bands, blue over yellow. The listed RGB values are 0, 87, 183 for the blue and 255, 215, 0 for the yellow, with Pantone 2935 C and Yellow 012 C. The flag was restored on 28 January 1992 after independence, and Ukraine celebrates the Day of the National Flag on 23 August. In international sport, Ukrainian teams wear yellow and blue, with the blue often very dark.
Sweden uses a yellow Nordic cross on blue. Its colors are officially set in the Natural Color System as NCS 0580-Y10R for the yellow and NCS 4055-R95B for the blue, and the design is believed to come from the 1442 coat of arms. Screens commonly approximate them as and , and Sweden’s blue is darker than Ukraine’s lighter azure. Kazakhstan and Palau also count blue and yellow among their national colors.
Teams and brands that lean on the pair:
- IKEA: Sweden’s most famous company uses blue and yellow extensively
- UCLA Bruins: blue and gold
- Michigan Wolverines: maize and blue
- Golden State Warriors: blue and yellow
Using Yellow and Blue in Web and UI Design
Give one color the job of surface and the other the job of signal. A blue hero with a yellow button works because the button stands out at 8.0:1 against its surroundings. For light interfaces, reverse the roles: a cool, icy near-white such as #F5FCFF as the page, navy for text, and yellow only for highlights and badges.
:root {
--blue: #0000FF;
--yellow: #FFFF00;
--ink: #14213D;
--paper: #F5FCFF;
}
.hero { background: var(--blue); color: var(--yellow); }
.button { background: var(--yellow); color: var(--blue); }
A reliable split is about 60% of the dominant color, 30% of a supporting tone and 10% accent. Body copy on white should drop to navy or a neutral like charcoal grey, since long paragraphs in saturated blue are tiring to read.
Try this: In the preview above, set yellow as the background and blue as the text, then swap them. Squint from arm’s length and note which version you can still read. Use that one for headings and give the other to your buttons.
Yellow and Blue Gradients Without the Muddy Middle
A straight gradient from to passes through flat grey. Average the two colors channel by channel and you land on roughly 128, 128, 128, so the center looks dead. I saw this on an onboarding screen I redesigned for a client: the banner looked like a smudge until we added a middle stop.
Why does a plain #0000FF to #FFFF00 gradient look grey in the middle?
Averaging the two colors channel by channel gives roughly 128, 128, 128, which is a neutral grey.
/* muddy middle */
background: linear-gradient(90deg, #0000FF, #FFFF00);
/* cleaner: add a green stop */
background: linear-gradient(90deg, #0000FF, #00A86B, #FFFF00);
/* modern browsers: interpolate in OKLCH */
background: linear-gradient(in oklch, #0000FF, #FFFF00);
Both fixes pull the transition through green, which is what paint does anyway. For angles, stops and layering, our orange gradient guide shows the CSS mechanics that apply to any hue pair.
Yellow and Blue in Art, Fashion and Interiors
Van Gogh leaned on this pair in The Starry Night and Café Terrace at Night: deep blue sky, glowing yellow light. It shows the rule that works everywhere. The dark color is the space, the bright color is the light.
In fashion, navy with mustard or pale lemon is the polished version, while bright primary-style pairings read sporty and playful. In rooms, a mid-blue wall with a yellow sofa, or deep blue cabinets against warm yellow curtains, works best when the yellow leans gold and the third color is white, cream or oak. Pure on a wall is a lot to live with, so save it for small objects.
Printing Yellow and Blue: What Changes in CMYK
Screens mix light and presses mix ink. is outside what CMYK inks can reproduce, so conversion turns it into a deeper, more violet blue. Yellow ink gets closer to , but it looks warmer and less glowing than a backlit display.

I once approved a poster in on screen and received a proof that was darker and clearly more purple than anything on my monitor. Since then I choose a print-safe blue like cobalt , ask for a physical proof, and specify Pantone matches for logos. Never judge a print color by the screen alone.
Four Ready-to-Use Yellow and Blue Palettes
These palettes are built from the shades above. Each one has a dark anchor, a light base and a clear accent, so you don’t have to balance the proportions yourself.
Posters, event flyers and playful brands where raw energy matters most.
Campaign pages, charity materials and sports kits with flag-style blue and gold.
Editorial sites, lookbooks and dashboards that need a grown-up, steady tone.
Nurseries, wedding stationery and soft app interfaces with calm contrast.
Start with Primary Pop for loud, screen-first work, Sky Over Wheat for flag-inspired projects, Navy and Mustard for grown-up brands, and Buttercream Morning when you need something soft.
Which Third Color Goes With Yellow and Blue?
White is the safest addition. It gives both colors room to breathe, and navy blue and white is a natural base layer under a yellow accent. Light grey and charcoal steady the pair in the same way.
For accents, a touch of red adds heat, and our red and blue page shows how that balance shifts. Orange makes the scheme warmer, and green makes it feel natural, since green is what the two colors produce when mixed. Keep the third color small, around 10% of the layout, or the pair loses its clarity.
Shades that keep this combination working
Yellow and Blue Color Scheme: questions people ask
What do yellow and blue make when mixed?
Mixing yellow and blue paint or ink gives green. Mixing them as light on a screen is different: #FFFF00 plus #0000FF adds up to white (#FFFFFF).
What is the hex code for yellow and blue?
Pure yellow is #FFFF00 (RGB 255, 255, 0) and pure blue is #0000FF (RGB 0, 0, 255). Most finished designs use softer shades such as gold #FFD700 and navy #14213D.
Is yellow text on a blue background accessible?
Pure yellow #FFFF00 on pure blue #0000FF has a contrast ratio of about 8.0:1, which passes WCAG AA and AAA for normal text. Other shade combinations need checking one by one.
Is yellow and blue a good color combination?
Yes. The pair has strong luminance contrast, a warm and cool balance, and a long record on flags, sports kits and retail brands. It works best when one color is dark and the other is light.
Which countries have blue and yellow flags?
Ukraine and Sweden are the best known, and Kazakhstan and Palau also use blue and yellow as national colors. Ukraine's flag is blue over yellow stripes, while Sweden's is a yellow cross on blue.
Keep exploring
- Pink and Purple Color Combination: Palettes and Hex Codes
- Orange and Black Color Scheme: Palettes and Hex Codes
- Blue and Black Color Combination: Palettes and Hex Codes
- Black and Grey Color Combination: Palettes and Hex Codes
- Orange and Brown Color Combination: Palettes and Hex Codes
- Brown and Black Color Palette: Combinations and Hex Codes
- Honey Blonde Color: Hex Code, RGB and Palettes
- Light Green Color: Hex Code, RGB and Palettes