WCAG and Color Contrast

A presentation at Web Directions: Access All Areas in October 2021 in by Todd Libby

Slide 1

Slide 1

WCAG & Color Contrast @toddlibby https://toddl.dev 1

Slide 2

Slide 2

Thank You! Sponsors, Hosts, Speakers, and Guests! 2

Slide 3

Slide 3

WCAG Web Content Accessibility Guidelines https://www.w3.org/TR/WCAG21/ 3

Slide 4

Slide 4

Success Criterion 1.4.3 Contrast (Minimum) (AA) • The visual presentation of text and images of text has a contrast ratio of at least 4.5:1, except for the following: (Level AA) • Large Text: Large-scale text and images of large-scale text have a contrast ratio of 3:1 • Incidental: Text or images of text that are part of an inactive user interface component, that are pure decoration, that are not visible to anyone, or that are part of a picture that contains signi cant other visual content, have no contrast requirement. • Logotypes: Text that is part of a logo or brand name has no minimum contrast requirement. https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html fi 4

Slide 5

Slide 5

How to Meet WCAG 2.0 Success Criterion (SC) • Situation A: text is < 18 point (24 px) if not bold and < 14 point (18.666666666666664 px). • Situation B: text is at least 18 point if not bold and at least 14 point if bold. https://www.w3.org/WAI/WCAG20/quickref/20160105/#visual-audio-contrast-contrast 5

Slide 6

Slide 6

6

Slide 7

Slide 7

Success Criterion 1.4.6 Contrast (Enhanced) (AAA) • Success Criterion 1.4.6 Contrast (Enhanced): The visual presentation of text and images of text has a contrast ratio of at least 7:1, except for the following: • Large Text: Large-scale text and images of large-scale text have a contrast ratio of at least 4.5:1 • Incidental: Text or images of text that are part of an inactive user interface component, that are pure decoration, that are not visible to anyone, or that are part of a picture that contains signi cant other visual content, have no contrast requirement. • Logotypes: Text that is part of a logo or brand name has no contrast requirement. https://www.w3.org/WAI/WCAG21/Understanding/contrast-enhanced.html fi 7

Slide 8

Slide 8

Success Criterion 1.4.11 Non-text Contrast (AA) Success Criterion 1.4.11 Non-text Contrast: The visual presentation of the following have a contrast ratio of at least 3:1 against adjacent colors: • User Interface Components: Visual information required to identify user interface components and states, except for inactive components or where the appearance of the component is determined by the user agent and not modi ed by the author; • Graphical Objects: Parts of graphics required to understand the content, except when a particular presentation of graphics is essential to the information being conveyed. https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html 8 fi •

Slide 9

Slide 9

Component Contrast Adjacent colors to at design radio buttons Example radio buttons using di erent color contrasts fl ff 9

Slide 10

Slide 10

Success Criterion 1.4.11 Non-text Contrast (AA) Success Criterion 1.4.11 Non-text Contrast: The visual presentation of the following have a contrast ratio of at least 3:1 against adjacent colors: • User Interface Components: Visual information required to identify user interface components and states, except for inactive components or where the appearance of the component is determined by the user agent and not modi ed by the author; • Graphical Objects: Parts of graphics required to understand the content, except when a particular presentation of graphics is essential to the information being conveyed. https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html 10 fi •

Slide 11

Slide 11

Bob Ross Painter, art instructor, TV host 11

Slide 12

Slide 12

“Mix up a little more shadow color here, then we can put us a little shadow right in there. See how you can move things around? You have unlimited power on this canvas—can literally, literally move mountains” ― Bob Ross 12

Slide 13

Slide 13

“We don’t make mistakes; we just have happy accidents.” — Bob Ross 13

Slide 14

Slide 14

14

Slide 15

Slide 15

15

Slide 16

Slide 16

What?! 16

Slide 17

Slide 17

What is the number one common failure in sites today regarding accessibility? 17

Slide 18

Slide 18

WebAIM Million Report - Low Contrast of text increased last year 18

Slide 19

Slide 19

19

Slide 20

Slide 20

Lea Verou’s Color Contrast Checker - https://contrast-ratio.com 20

Slide 21

Slide 21

Who Can Use: https://whocanuse.com 21

Slide 22

Slide 22

MORE! • WCAG Contrast Checker: https://contrastchecker.com • WebAIM Contrast Checker: https://webaim.org/resources/contrastchecker • ColourContrast: https://colourcontrast.cc • RandomA11y: https://randoma11y.com • Button Contrast Checker: https://www.aditus.io/button-contrast-checker/ 22

Slide 23

Slide 23

Browser Extensions 23

Slide 24

Slide 24

• WAVE: https://wave.webaim.org/extension • Axe: https://www.deque.com/axe • Firefox & Chrome DevTools 24

Slide 25

Slide 25

Firefox Vision Simulator 25

Slide 26

Slide 26

Chrome DevTools • This feature is built-in • No con g required • Toggle the element on the page to enable modal See what I did here? fi 26

Slide 27

Slide 27

Color Contrast Apps • Pika https://superhigh ves.com/pika - MacOS • Contraste https://contrasteapp.com/ - MacOS • Colour Contrast Analyser (CCA) https://www.tpgi.com/colorcontrast-checker/ - Windows • Chromatic Vision Simulator by Kazunori Asada for iOS/Android • VisionSim by The Braille Instititue for iOS fi 27

Slide 28

Slide 28

fi Color Palette Testers • Contrast Grid - https://contrast- grid.eightshapes.com • Accessible Color Palette Builder - https:// toolness.github.io/accessible-color-matrix/ • Tanaguru Contrast Finder - https://contrastnder.tanaguru.com/ • A11y Color Palette - http://a11yrocks.com/ colorPalette/ 28

Slide 29

Slide 29

Tips for Great Color Contrast sizes, and colors matter. • Font weights, • Test your color palettes. • Ratios that exceed the minimums of 4.5 to 1, 3 to 1, or 7 to 1. • Avoid stark contrasts with text which can result in blurred text. 29

Slide 30

Slide 30

Captions! 30

Slide 31

Slide 31

“Readability is the most important aspect of captioning in video. No other rules matter if captions cannot be read.” –Meryl K. Evans 31

Slide 32

Slide 32

This is a lobster roll. They are delicious! They are the best food in the entire world and I love to eat them! 32

Slide 33

Slide 33

This is a lobster roll. They are delicious! They are the best food in the entire world and I love to eat them! 33

Slide 34

Slide 34

A11y is a right. NOT a privilege. — Me🦞 https://cottonbureau.com/products/a11y-is-a-right#/5254643/ 34

Slide 35

Slide 35

Thank You! Slides: https://noti.st/colabottles/gcPUQc/color-contrast-and-wcag 35 @toddlibby