GitHub Color Palette
#0D1117 · #58A6FF · #21262D · #C9D1D9
Use #0D1117 as the background. Use #58A6FF as the primary accent. Use #21262D as secondary. Use #C9D1D9 as body text/supporting color. Palette mood: GitHub — night, cool, minimal.
Hex Codes, RGB & CMYK Color Values
Technical breakdown for the GitHub color scheme. Use these values for web design (HEX/RGB), print projects (CMYK), or specialized design software (HSL).
| Swatch | Design Role | HEX | RGB | CMYK | HSL |
|---|---|---|---|---|---|
| Background Luminance: 0.5% | 13, 17, 23 | 43%, 26%, 0%, 91% | 216°, 28%, 7% | ||
| Text · AAA Luminance: 36.6% | 88, 166, 255 | 65%, 35%, 0%, 0% | 212°, 100%, 67% | ||
| Decorative / accent Luminance: 1.9% | 33, 38, 45 | 27%, 16%, 0%, 82% | 215°, 15%, 15% | ||
| Text · AAA Luminance: 63.0% | 201, 209, 217 | 7%, 4%, 0%, 15% | 210°, 17%, 82% |
GitHub Tints & Shades
Hover states, borders and elevation need lighter and darker steps of your base colors. Here are computed tints and shades for every color in the GitHub palette — click any swatch to copy its hex.
GitHub Palette Contrast Matrix (WCAG 2.1)
Every color tested as text on every other color as background. Body copy needs 4.5:1 (AA), large text and UI components 3:1. AAA requires 7:1.
| Text on Background | Preview | Ratio | Grade | Safe For |
|---|---|---|---|---|
| #C9D1D9 on #0D1117 |
Aa Sample Text
| 12.26:1 | AAA | Body text, headings, UI |
| #0D1117 on #C9D1D9 |
Aa Sample Text
| 12.26:1 | AAA | Body text, headings, UI |
| #C9D1D9 on #21262D |
Aa Sample Text
| 9.86:1 | AAA | Body text, headings, UI |
| #21262D on #C9D1D9 |
Aa Sample Text
| 9.86:1 | AAA | Body text, headings, UI |
| #58A6FF on #0D1117 |
Aa Sample Text
| 7.49:1 | AAA | Body text, headings, UI |
| #0D1117 on #58A6FF |
Aa Sample Text
| 7.49:1 | AAA | Body text, headings, UI |
| #21262D on #58A6FF |
Aa Sample Text
| 6.02:1 | AA | Body text, UI |
| #58A6FF on #21262D |
Aa Sample Text
| 6.02:1 | AA | Body text, UI |
| #C9D1D9 on #58A6FF |
Aa Sample Text
| 1.63:1 | Fail | Decorative use only |
| #58A6FF on #C9D1D9 |
Aa Sample Text
| 1.63:1 | Fail | Decorative use only |
| #21262D on #0D1117 |
Aa Sample Text
| 1.24:1 | Fail | Decorative use only |
| #0D1117 on #21262D |
Aa Sample Text
| 1.24:1 | Fail | Decorative use only |
Color Harmony: Monochromatic
4 of 4 colors sit at essentially the same hue (213°, cyan-blue); the palette varies them by lightness and saturation rather than hue.
Single-hue palettes are the easiest to keep consistent, but neighbouring slots can look flat — separate them with lightness steps of at least 15%.
History & Design Context
Best Design Use Cases
Measured best pair: #C9D1D9 on #0D1117 at 12.26:1 (AAA). Use this pair for paragraph copy; the surface roles above are not body-text prescriptions.
A code-surface hierarchy with one electric blue
Code needs a calm canvas and an unmistakable link colour. #C9D1D9 on #0D1117 gives 12.26:1 for code and prose; #21262D raises cards and toolbars, and #58A6FF marks links and focus. Keep the blue out of syntax highlighting so it always means interactive.
In a code interface the blue must mean “interactive”. Keep it off syntax highlighting and static labels, use the grey steps for hierarchy, and make sure focus rings are visible against both the canvas and the raised surface.
Industries This Palette Suits
Colors That Pair Well With GitHub
Need a fifth color? These three companions are computed from the palette's own hue positions on the color wheel, so they extend the scheme without breaking its harmony.
directly opposite #58A6FF on the wheel — the strongest accent for CTAs and highlights when you need maximum energy
30° beside #58A6FF — a calm secondary that extends the palette without adding tension
a paper-white carrying the palette's own hue — perfect for surfaces and dividers
Using GitHub Without Breaking Accessibility
- Use #58A6FF for buttons and links — it scores 7.49:1 against the #0D1117 background (above the 3:1 UI-components threshold).
- Set body text in #C9D1D9 — 12.26:1 against #0D1117 passes WCAG AA (AAA) for long-form reading.
- Let #21262D carry sidebars, cards and footers — at a deep lightness it separates zones without stealing focus from #58A6FF.
How to Implement the GitHub Color Scheme
To use this GitHub color palette in your web project, copy the CSS variables below or open the export panel for Tailwind, SCSS and Figma formats.
Option 1: CSS Variables
:root {
/* GitHub — ihatecolors */
--color-bg: #0D1117;
--color-accent: #58A6FF;
--color-secondary: #21262D;
--color-text: #C9D1D9;
} Web Design Tip
Use #0D1117 as the page background and #58A6FF for primary buttons — they measure 7.49:1, which clears both the 3:1 UI threshold and the 4.5:1 body-text threshold.
Accessibility Note
Body copy in #C9D1D9 on #0D1117 measures 12.26:1, which passes WCAG AAA for normal text.
GitHub Palette — Frequently Asked Questions
What are the hex codes in the GitHub color palette?
The GitHub palette contains #0D1117, #58A6FF, #21262D, #C9D1D9. Click any swatch on this page to copy its value, or export all four at once as CSS variables, Tailwind config, SCSS or a Figma-ready list.
Is the GitHub color palette accessible (WCAG)?
Yes. #C9D1D9 on #0D1117 reaches 12.26:1, which passes WCAG AAA for normal text (7:1) as well as AA and the 3:1 UI threshold — use it for body copy and controls. The full contrast matrix above shows the exact score for every color-on-color pair in this palette.
What colors go well with the GitHub palette?
Beyond its own four colors, #FFB057, #645FF7, #ECEDEE extend it naturally: the complementary hue for high-energy accents, an analogous neighbor for calm transitions, and a tinted neutral for surfaces. All three are computed from this palette's hues on the color wheel.
What mood does the GitHub palette create?
GitHub reads as night, cool, minimal. Saturated cyan-blue drives the personality, grounded by gently saturated blue — a combination that works best when the deep base gets most of the canvas.
Can I use the GitHub color palette commercially?
Yes. Individual color values can't be copyrighted, so the GitHub palette is free for personal, client and commercial work — websites, branding, apps, print and social content, with no attribution required.
How do I add the GitHub palette to Tailwind or CSS?
Use the export panel on this page: CSS variables, a Tailwind config block, SCSS variables, or a Figma copy list are generated from GitHub's exact values, including the tint and shade ramps shown above.