Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
15 years ago…
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
7 years ago…
2012
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
She had a long
history…
The
grandma
2012 From
To
They founded their
label and…
The Man
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Today
Mauricio Palma
Co-founder and all kind of things @WDLK
Product Engineer @sinnerschrader
everywhere else @palmaswell
But
Why?
Back in
The Day
Way
harder!
opportunity
Nature
of the web
We use our
our abilities
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
You can’t read
this sentence
A11y automation
April, 2019
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
That was
awkward! Right?
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Literally
hurts!
217 million
How to
fix the
numbers?
Blurry Vision
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Key Takeaways
Publish all information and content from your site in your HTML
Use semantic HTML and the appropriate ARIA landmarks
Write screen reader friendly markup
Provide keyboard navigation
Partial vision loss
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Key Takeaways
Besides the mentioned semantic HTML and screen reader friendly markup
You should follow a linear logical layout, that supports at least 200% magnification
Central vision loss
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Key Takeaways
Always put form elements in context. Meaning putting buttons, inputs, and notifications
together in a logical manner
For action elements in your interface use a good combination of colors, shapes, and text
Do not rely on colors to convey meaning
Dyslexia
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Key Takeaways
Align your text to the left and keep a consistent layout
Keep content short, clear and simple
Consider producing materials in other formats (for example audio or video)
Let the users change the contrast between background and text
Colorblindness
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Key Takeaways
Make sure that colors are not your only method of conveying important information.
Sunlight
Bad lightning
Temporary disabilities
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Persona
Permanent Temporary Situational
Benefits
New opportunities
Offer utility and elegance
Profitable
Legal compliance
We usetechnologyto includemore people
Color Contrast
Can your read this?
Color contrast
1.6 ratio
Can your read this?
Color contrast
8.05 ratio AAA
Color Contrast
Automation
Guideline 1.4 Distinguishable
AA >= 4.5:1
AAA >= 7:1
AA >= 3:1
Large-scale text
AAA >= 4.5:1
Large-scale text
24px || 19px bold
Large-scale text
Logos and brand
Other exceptions
Inactive UI elements
Other exceptions
Make it easier for users to see and hear content including
separating foreground from background.
Guideline 1.4 Distinguishable:
Note 1: For the sRGB colorspace, the relative luminance of a color is defined as L =
0.2126 * R + 0.7152 * G + 0.0722 * B where R, G and B are defined as:
if RsRGB <= 0.03928 then R = RsRGB/12.92 else R = ((RsRGB+0.055)/1.055) ^ 2.4
if GsRGB <= 0.03928 then G = GsRGB/12.92 else G = ((GsRGB+0.055)/1.055) ^ 2.4
if BsRGB <= 0.03928 then B = BsRGB/12.92 else B = ((BsRGB+0.055)/1.055) ^ 2.4
WCAG definition of relative luminance
Excuseme?
Luminance
Relative
Luminance
0
1
Note 1: For the sRGB color space, the
relative luminance of a color is defined
as L = 0.2126 * R + 0.7152 * G + 0.0722
* B where R, G and B are defined as:
WCAG
definition
of relative
luminance
standardized by the
International Electrotechnical
Commission
sRGB
sRGB
Our visual
system
Works in a
similar way
Default
color space
Human SystemWeb Browsers
RGBStep 1
export type RGB = [
number,
number,
number
];
Statically define the kind of
data we expect.
Chromaticity
| Chromaticity | Red | Green | Blue | White point |
|--------------|---------|-----------|----------|--------------|
| x | 0.6400 | 0.3000 | 0.1500 | 0.3127 |
| y | 0.3300 | 0.6000 | 0.0600 | 0.3290 |
| Y | 0.2126 | 0.7152 | 0.0722 | 1.0000 |
export enum YValues {
r = 0.2126,
g = 0.7152,
b = 0.0722,
}
xyY color
space
Step 1
Y values represent the
luminance of a color entry
export function calculateRGBEntry(
entry: number,
y: Type.YValues): number {
const average = entry / 255;
return average <= 0.03928
? average / 12.92 * y
: ((average + 0.055) / 1.055 ) ** 2.4 * y;
};
Color
contrast
Step 2
Color
contrast
Step 2
export function luminance(
sRGB: Type.RGB
): number {
return calculateRGBEntry(sRGB[0], Type.YValues.r)
+ calculateRGBEntry(sRGB[1], Type.YValues.g)
+ calculateRGBEntry(sRGB[2], Type.YValues.b);
}
Color
contrast
Step 2
export function contrastRatio(
sRGB: Type.RGB,
sRGB2: Type.RGB): number {
const light = Math.max(luminance(sRGB), luminance(sRGB2));
const dark = Math.min(luminance(sRGB), luminance(sRGB2));
return +((light + 0.05) / (dark + 0.05)).toFixed(2);
}
The other
day
The other
day
The other
day
Color Contrast
Automation
N colors
Aa Aa Aa Aa
[ ]
AaAaAaAaAa
Linear
Search
AAA
Time
complexity
O(n^2) worst case O(50^2) worst case
A 50 color array would require 2500
iterations.
^ === exponent
What about Tails
position call?
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Quicksort
Binary search
Hash table
Theme provider
New
(kind of naive)
Strategy
Quicksort
fast sorting algorithm
SortStep 3
export function quickSort(
arr: Type.Color[],
cb: (sRGB: Type.RGB) => number,
lo: number,
hi: number
): void {
if (lo < hi) {
const pivot = cb(arr[Math.floor((lo + hi) / 2)].rgb);
const p = partition(arr, lo, hi, pivot, cb);
quickSort(arr, cb, lo, p.hi);
quickSort(arr, cb, p.lo, hi);
}
}
export function sort(
arr: Type.Color[],
cb: (sRGB: Type.RGB) => number) {
return quickSort(arr, cb, 0, arr.length - 1);
}
SortStep 3
export function partition(
arr: Type.Color[],
lo: number,
hi: number,
pivot: number,
cb: (sRGB: Type.RGB) => number): { lo: number, hi: number} {
if (lo <= hi) {
if (cb(arr[lo].rgb) < pivot) {
return partition(arr, lo + 1, hi, pivot, cb);
}
if (cb(arr[hi].rgb) > pivot) {
return partition(arr, lo, hi - 1, pivot, cb);
}
if (lo <= hi) {
swap(arr, lo, hi);
return partition(arr, lo + 1, hi - 1, pivot, cb);
}
}
return { lo, hi };
}
SortStep 3
export function quickSort(
arr: Type.Color[],
cb: (sRGB: Type.RGB) => number,
lo: number,
hi: number
): void {
if (lo < hi) {
const pivot = cb(arr[Math.floor((lo + hi) / 2)].rgb);
const p = partition(arr, lo, hi, pivot, cb);
quickSort(arr, cb, lo, p.hi);
quickSort(arr, cb, p.lo, hi);
}
}
export function sort(
arr: Type.Color[],
cb: (sRGB: Type.RGB) => number) {
return quickSort(arr, cb, 0, arr.length - 1);
}
AaAaAaAaAa
QuicksortStep 3
Aa Aa AaAaAa
Sorted by
luminance
Step 3
Binary Search
efficient algorithm that searches
a sorted list
Aa Aa AaAaAa
Binary
Search
Step 4 AAA color contrast check
Match!
SearchStep 4 function lowerSearch<T extends QuickSearch>(
arr: Array<T>,
el: T,
val: number,
lo: number,
hi: number): number | [] {
const mid = Math.floor((lo + hi) / 2);
const prev = mid - 1;
const next = mid + 1;
const midRatio = contrastRatio(arr[mid].rgb, el.rgb);
if (lo < hi) {
if (midRatio > val && prev >= 0) {
if (contrastRatio(arr[prev].rgb, el.rgb) < val) {
return mid;
}
return lowerSearch(arr, el, val, lo, mid);
}
if (midRatio < val && next < arr.length) {
if (contrastRatio(arr[next].rgb, el.rgb) > val) {
return next;
}
return lowerSearch(arr, el, val, mid, hi)
}
if (mid === val) {
return mid;
}
}
return [];
};
export function search(
arr: Type.Color[],
el: Type.Color,
val: Type.A11yRatio,
type?: Type.Search): number | [] {
if (type === Type.Search.upper) {
return upperSearch(arr, el, val, 0, arr.length);
}
return lowerSearch(arr, el, val, 0, arr.length);
};
Color
Enhanced
Enhanced
colors
Step 5
export function createEnhanced(
rawColor: Type.Color,
aaa: Type.Color[] | [],
aa: Type.Color[] | []
): Type.colorEnhanced {
const rgb = rawColor.rgb;
return {
name: rawColor.name,
rgb,
aaa,
aa,
toRGB(): string {
return toRGBString(rgb);
},
toHEX(): string {
return tinyColor(toRGBString(rgb)).toHexString();
},
toHSL(): string {
return tinyColor(toRGBString(rgb)).toHslString();
},
toRGBA(alpha: number): string {
const color = tinyColor(toRGBString(rgb));
color.setAlpha(alpha);
return color.toRgbString()
}
}
}
Demo
It’s open source
https://github.com/Palmaswell/forward
Use it, play with it, make it better!
Questions?
Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019
Thanks!Github: @palmaswell
Twitter: @palmaswell

More Related Content

PDF
JS Fest 2019. Mauricio Palma. You can’t read this sentence - A11y automation
PDF
Power of functions in a typed world
PDF
Functional and Algebraic Domain Modeling
PDF
Mining Functional Patterns
PDF
Architectural Patterns in Building Modular Domain Models
PDF
Algebraic Thinking for Evolution of Pure Functional Domain Models
PDF
201801 CSE240 Lecture 07
PDF
Approximation Data Structures for Streaming Applications
JS Fest 2019. Mauricio Palma. You can’t read this sentence - A11y automation
Power of functions in a typed world
Functional and Algebraic Domain Modeling
Mining Functional Patterns
Architectural Patterns in Building Modular Domain Models
Algebraic Thinking for Evolution of Pure Functional Domain Models
201801 CSE240 Lecture 07
Approximation Data Structures for Streaming Applications

What's hot (11)

PPSX
Boolean algebra simplification and combination circuits
PDF
Category Theory for Programmers
PPT
DSL - expressive syntax on top of a clean semantic model
PDF
Functional and Event Driven - another approach to domain modeling
PPTX
8086 ins2 math
PPTX
Chap3 8086 artithmetic
PDF
An Algebraic Approach to Functional Domain Modeling
PPTX
Category theory for beginners
Boolean algebra simplification and combination circuits
Category Theory for Programmers
DSL - expressive syntax on top of a clean semantic model
Functional and Event Driven - another approach to domain modeling
8086 ins2 math
Chap3 8086 artithmetic
An Algebraic Approach to Functional Domain Modeling
Category theory for beginners
Ad

Similar to Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019 (20)

PDF
Sorbet at Grailed
DOCX
GSP 215 Entire Course NEW
DOCX
GSP 215 RANK Lessons in Excellence-- gsp215rank.com
DOCX
GSP 215 RANK Education Your Life--gsp215rank.com
DOCX
GSP 215 RANK Inspiring Innovation--gsp215rank.com
DOCX
Compilers Final spring 2013 model answer
ODP
What I Love About Ruby
PDF
GSP 215 RANK Introduction Education--gsp215rank.com
PDF
GSP 215 RANK Education Counseling--gsp215rank.com
PDF
GSP 215 RANK Education Planning--gsp215rank.com
DOCX
GSP 215 RANK Education Counseling -- gsp215rank.com
PDF
AVR Programming of ATmega32 detailed .pdf
PDF
Workshop - Hadoop + R by CARLOS GIL BELLOSTA at Big Data Spain 2013
DOCX
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
PPTX
Loom & Functional Graphs in Clojure @ LambdaConf 2015
PDF
Model answer of compilers june spring 2013
PPTX
cppt-170218053903.pptxhjkjhjjjjjjjjjjjjjjj
PPT
Session 19 - MapReduce
PPT
CS 354 Pixel Updating
PDF
Writing DSL with Applicative Functors
Sorbet at Grailed
GSP 215 Entire Course NEW
GSP 215 RANK Lessons in Excellence-- gsp215rank.com
GSP 215 RANK Education Your Life--gsp215rank.com
GSP 215 RANK Inspiring Innovation--gsp215rank.com
Compilers Final spring 2013 model answer
What I Love About Ruby
GSP 215 RANK Introduction Education--gsp215rank.com
GSP 215 RANK Education Counseling--gsp215rank.com
GSP 215 RANK Education Planning--gsp215rank.com
GSP 215 RANK Education Counseling -- gsp215rank.com
AVR Programming of ATmega32 detailed .pdf
Workshop - Hadoop + R by CARLOS GIL BELLOSTA at Big Data Spain 2013
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
Loom & Functional Graphs in Clojure @ LambdaConf 2015
Model answer of compilers june spring 2013
cppt-170218053903.pptxhjkjhjjjjjjjjjjjjjjj
Session 19 - MapReduce
CS 354 Pixel Updating
Writing DSL with Applicative Functors
Ad

More from Codemotion (20)

PDF
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
PDF
Pompili - From hero to_zero: The FatalNoise neverending story
PPTX
Pastore - Commodore 65 - La storia
PPTX
Pennisi - Essere Richard Altwasser
PPTX
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
PPTX
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
PPTX
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
PPTX
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
PDF
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
PDF
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
PDF
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
PDF
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
PDF
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
PDF
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
PPTX
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
PPTX
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
PDF
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
PDF
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
PDF
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
PDF
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Pompili - From hero to_zero: The FatalNoise neverending story
Pastore - Commodore 65 - La storia
Pennisi - Essere Richard Altwasser
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019

Recently uploaded (20)

PPTX
2018-HIPAA-Renewal-Training for executives
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Getting started with AI Agents and Multi-Agent Systems
DOCX
search engine optimization ppt fir known well about this
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Configure Apache Mutual Authentication
PDF
Five Habits of High-Impact Board Members
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PPTX
The various Industrial Revolutions .pptx
PPTX
Microsoft Excel 365/2024 Beginner's training
PPTX
Chapter 5: Probability Theory and Statistics
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PDF
UiPath Agentic Automation session 1: RPA to Agents
PDF
STKI Israel Market Study 2025 version august
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
sustainability-14-14877-v2.pddhzftheheeeee
2018-HIPAA-Renewal-Training for executives
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Getting started with AI Agents and Multi-Agent Systems
search engine optimization ppt fir known well about this
A proposed approach for plagiarism detection in Myanmar Unicode text
Zenith AI: Advanced Artificial Intelligence
Configure Apache Mutual Authentication
Five Habits of High-Impact Board Members
Convolutional neural network based encoder-decoder for efficient real-time ob...
The various Industrial Revolutions .pptx
Microsoft Excel 365/2024 Beginner's training
Chapter 5: Probability Theory and Statistics
A review of recent deep learning applications in wood surface defect identifi...
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
NewMind AI Weekly Chronicles – August ’25 Week III
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
UiPath Agentic Automation session 1: RPA to Agents
STKI Israel Market Study 2025 version august
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
sustainability-14-14877-v2.pddhzftheheeeee

Mauricio Palma - You can’t read this sentence - A11y automation - Codemotion Amsterdam 2019