question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Color combinations that fail WCAG 2 AA 4.5:1 contrast ratio

See original GitHub issue

Doubt that all of these will be tackled, but for reference (following https://github.com/twbs/bootstrap/pull/25123 which at least fixed one of the badly borked ones):

From http://getbootstrap.com/docs/4.0/getting-started/theming/

Blue Foreground: #FFFFFF Background: #007BFF The contrast ratio is: 4.0:1 Text failed at Level AA

Indigo Foreground: #FFFFFF Background: #6610F2 The contrast ratio is: 7.2:1 Text passed at Level AA

Purple Foreground: #FFFFFF Background: #6F42C1 The contrast ratio is: 6.5:1 Text passed at Level AA

Pink Foreground: #FFFFFF Background: #E83E8C The contrast ratio is: 3.8:1 Text failed at Level AA

Red Foreground: #FFFFFF Background: #DC3545 The contrast ratio is: 4.5:1 Text passed at Level AA

Orange Foreground: #212529 Background: #FD7E14 The contrast ratio is: 6.0:1 Text passed at Level AA

Yellow Foreground: #212529 Background: #FFC107 The contrast ratio is: 9.5:1 Text passed at Level AA

Green Foreground: #FFFFFF Background: #28A745 The contrast ratio is: 3.1:1 Text failed at Level AA

Teal Foreground: #FFFFFF Background: #20C997 The contrast ratio is: 2.1:1 Text failed at Level AA

Cyan Foreground: #FFFFFF Background: #17A2B8 The contrast ratio is: 3.0:1 Text failed at Level AA

From http://getbootstrap.com/docs/4.0/utilities/colors/

.text-primary Foreground: #007BFF Background: #FFFFFF The contrast ratio is: 4.0:1 Text failed at Level AA

.text-secondary Foreground: #6C757D Background: #FFFFFF The contrast ratio is: 4.7:1 Text passed at Level AA

.text-success Foreground: #28A745 Background: #FFFFFF The contrast ratio is: 3.1:1 Text failed at Level AA

.text-danger Foreground: #DC3545 Background: #FFFFFF The contrast ratio is: 4.5:1 Text passed at Level AA

.text-warning Foreground: #FFC107 Background: #FFFFFF The contrast ratio is: 1.6:1 Text failed at Level AA

.text-info Foreground: #17A2B8 Background: #FFFFFF The contrast ratio is: 3.0:1 Text failed at Level AA

.text-light Foreground: #F8F9FA Background: #343A40 The contrast ratio is: 10.9:1 Text passed at Level AA

.text-dark Foreground: #343A40 Background: #FFFFFF The contrast ratio is: 11.5:1 Text passed at Level AA

.text-muted Foreground: #6C757D Background: #FFFFFF The contrast ratio is: 4.7:1 Text passed at Level AA

.text-white Foreground: #FFFFFF Background: #343A40 The contrast ratio is: 11.5:1 Text passed at Level AA

.bg-primary Foreground: #FFFFFF Background: #007BFF The contrast ratio is: 4.0:1 Text failed at Level AA

.bg-secondary Foreground: #FFFFFF Background: #6C757D The contrast ratio is: 4.7:1 Text passed at Level AA

.bg-success Foreground: #FFFFFF Background: #28A745 The contrast ratio is: 3.1:1 Text failed at Level AA

.bg-danger Foreground: #FFFFFF Background: #DC3545 The contrast ratio is: 4.5:1 Text passed at Level AA

.bg-warning Foreground: #343A40 Background: #FFC107 The contrast ratio is: 7.1:1 Text passed at Level AA

.bg-info Foreground: #FFFFFF Background: #17A2B8 The contrast ratio is: 3.0:1 Text failed at Level AA

.bg-dark Foreground: #FFFFFF Background: #343A40 The contrast ratio is: 11.5:1 Text passed at Level AA

.bg-white Foreground: #343A40 Background: #FFFFFF The contrast ratio is: 11.5:1 Text passed at Level AA

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:20 (11 by maintainers)

github_iconTop GitHub Comments

10reactions
patrickhlaukecommented, Dec 29, 2017

(and yes, i did collate that list manually, as i know how to party on a friday night 😉 )

4reactions
michaelwayneharris87commented, Mar 20, 2019

In our extension of Bootstrap, we’ve added functions to lighten or darken colors until they meet minimum contrast, and updated the mixins to use those functions.

I’d love to see an option for $enable-force-accessible-contrast that would automatically generate accessible versions of components if set to true, regardless of what color was passed into the relevant mixins.

If that’s of interest, I’ll share some of our code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

G18: Ensuring that a contrast ratio of at least 4.5:1 ... - W3C
3, this technique describes the minimum contrast ratio for text that is less than 18 point (if not bold) and less than 14...
Read more >
Understanding WCAG 2 Contrast and Color Requirements
1 Use of Color. WCAG 2 does not prohibit any specific color or color combination, such as red and green. The previous success...
Read more >
Color and Color Contrast - Accessibility Toolkit for Course ...
The WCAG 2.0 require that color combinations meet clearly defined contrast ratios. In order to meet the guidelines at Level AA, ...
Read more >
WCAG: Accessible colour and contrast ratios | by Andy Barnes
Three boxes showing examples of contrast fails and passes against level AA. Examples of colour combinations for 1.4.3 Contrast (Minimum).
Read more >
Color and Contrast on Web Pages - Penn State | Accessibility
An important aspect of color on the Web for both low vision and colorblind users is sufficient contrast between foreground (text or graphics)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found