Skip to content

Commit

Permalink
Colour contrast image fixes (#863)
Browse files Browse the repository at this point in the history
* Colours that meet 4.5 contrast ratio

* Fix typos

* Grayscale changes

* Fix typo

* More grayscale fixes

* Add code elements

* Clean up SVG

* Update image based on @OBTo's feedback

* New version of image
  • Loading branch information
tunetheweb authored May 27, 2020
1 parent e6cb73b commit 358563a
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 21 deletions.
8 changes: 4 additions & 4 deletions src/content/en/2019/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ The primary goal of a web page is to deliver content users want to engage with.

There are many cases where visitors to your site may not be able see it perfectly. Visitors may be colorblind and unable to distinguish between the font and background color ([1 in every 12 men and 1 in 200 women](http://www.cvrl.org/people/stockman/pubs/1999%20Genetics%20chapter%20SSJN.pdf) of European descent). Perhaps they're simply reading while the sun is out and creating tons of glare on their screen—significantly impairing their vision. Or maybe they've just grown older and their eyes can't distinguish colors as well as they used to.

In order to make sure your website is readable under these conditions, making sure your text has sufficient color contrast with its background is critical.
In order to make sure your website is readable under these conditions, making sure your text has sufficient color contrast with its background is critical. It is also important to consider what contrasts will be shown when the colors are converted to grayscale.

<figure>
<a href="/static/images/2019/accessibility/example-of-good-and-bad-color-contrast-lookzook.png">
<img alt="Figure 1. Example of what text with insufficient color contrast looks like. Courtesy of LookZook" aria-labelledby="fig1-caption" aria-describedby="fig1-description" src="/static/images/2019/accessibility/example-of-good-and-bad-color-contrast-lookzook.png" width="600" height="278">
<a href="/static/images/2019/accessibility/example-of-good-and-bad-color-contrast-lookzook.svg">
<img alt="Figure 1. Example of what text with insufficient color contrast looks like. Courtesy of LookZook" aria-labelledby="fig1-caption" aria-describedby="fig1-description" src="/static/images/2019/accessibility/example-of-good-and-bad-color-contrast-lookzook.svg" width="568" height="300">
</a>
<div id="fig1-description" class="visually-hidden">Four colored boxes of orange and gray shades with white text overlaid inside creating two columns. The left column says Too lightly colored and has the orange background color written as #FCA469. The right column says Recommended and the orange background color is written as #F56905. The top box in each column has an orange background with white text #FFFFFF and the bottom box has a gray background with white text #FFFFFF. The grey background shows the orange color in greyscale. Courtesy of LookZook.</div>
<div id="fig1-description" class="visually-hidden">Four colored boxes of brown and gray shades with white text overlaid inside creating two columns. The left column says Too lightly colored and has the brown background color written as <coce>#FCA469</code>. The right column says Recommended and the brown background color is written as <code>#BD5B0E</code>. The top box in each column has an brown background with white text <code>#FFFFFF</code> and the bottom box has a gray background with white text <code>#FFFFFF</code>. The grayscale equivalents are <code>#B8B8B8</code> and <code>#707070</code> respectively. Courtesy of LookZook</div>
<figcaption id="fig1-caption">Figure 1. Example of what text with insufficient color contrast looks like. Courtesy of LookZook</figcaption>
</figure>

Expand Down
8 changes: 4 additions & 4 deletions src/content/en/2019/mobile-web.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ When designing our sites we tend to be in more optimal conditions, and have far
To help us mitigate this problem, there are [accessibility guidelines](https://dequeuniversity.com/rules/axe/2.2/color-contrast) we can follow when choosing our text and background colors. So how are we doing in meeting these baselines? Only 22.04% of sites give all their text sufficient color contrast. This value is actually a lower limit, as we could only analyze text with solid backgrounds. Image and gradient backgrounds were unable to be analyzed.

<figure>
<a href="/static/images/2019/mobile-web/example-of-good-and-bad-color-contrast-lookzook.png">
<img src="/static/images/2019/mobile-web/example-of-good-and-bad-color-contrast-lookzook.png" alt="Figure 4. Example of what text with insufficient color contrast looks like. Courtesy of LookZook" aria-labelledby="fig4-caption" aria-describedby="fig4-description" width="650" height="300">
<a href="/static/images/2019/mobile-web/example-of-good-and-bad-color-contrast-lookzook.svg">
<img src="/static/images/2019/mobile-web/example-of-good-and-bad-color-contrast-lookzook.svg" alt="Figure 4. Example of what text with insufficient color contrast looks like. Courtesy of LookZook." aria-labelledby="fig4-caption" aria-describedby="fig4-description" width="568" height="300">
</a>
<div id="fig4-description" class="visually-hidden">Four colored boxes of orange and gray shades with white text overlaid inside creating two columns, one where the background color is too lightly colored compared to the white text and one where the background color is recommended compared to the white text. The hex code of each color is displayed, white is <code>#FFFFFF</code>, the light shade of orange background is <code>#FCA469</code>, and the recommended shade of orange background is <code>#F56905</code>. Image courtesy of LookZook</div>
<figcaption id="fig4-caption">Figure 4. Example of what text with insufficient color contrast looks like. Courtesy of LookZook</figcaption>
<div id="fig4-description" class="visually-hidden">Four colored boxes of brown and gray shades with white text overlaid inside creating two columns, one where the background color is too lightly colored compared to the white text and one where the background color is recommended compared to the white text. The hex code of each color is displayed, white is <code>#FFFFFF</code>, the light shade of brown background is <code>#FCA469</code>, and the recommended shade of brown background is <code>#BD5B0E</code>. The grayscale equivalents are <code>#B8B8B8</code> and <code>#707070</code> respectively. Image courtesy of LookZook</div>
<figcaption id="fig4-caption">Figure 4. Example of what text with insufficient color contrast looks like. Courtesy of LookZook.</figcaption>
</figure>

For colorblindness stats for other demographics, see [this paper](https://web.archive.org/web/20180304115406/http://www.allpsych.uni-giessen.de/karl/colbook/sharpe.pdf).
Expand Down
8 changes: 4 additions & 4 deletions src/content/fr/2019/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ Le principal objectif d’une page web est de fournir du contenu avec lequel les

Il existe de nombreux cas où les visiteurs de votre site peuvent ne pas le voir parfaitement. Les visiteurs peuvent être daltoniens et être dans l’impossibilité de faire la distinction entre la police et la couleur d’arrière-plan ([1 homme sur 12 et 1 femme sur 200](http://www.cvrl.org/people/stockman/pubs/1999%20Genetics%20chapter%20SSJN.pdf) en Europe). Peut-être qu’ils lisent simplement en extérieur avec un soleil créant des tonnes de reflets sur leur écran — ce qui nuit considérablement à leur vision. Ou peut-être qu’ils ont simplement vieilli et que leurs yeux ne peuvent pas distinguer les couleurs aussi bien qu’auparavant.

Afin de vous assurer que votre site web soit lisible dans ces conditions, un contraste de couleur suffisant entre le texte et son arrière-plan est capital.
Afin de vous assurer que votre site web soit lisible dans ces conditions, un contraste de couleur suffisant entre le texte et son arrière-plan est capital. また、色がグレースケールに変換されるときにどのようなコントラストが表示されるかを考慮することも重要です。

<figure>
<a href="/static/images/2019/accessibility/example-of-good-and-bad-color-contrast-lookzook.png">
<img alt="Figure 1. Exemple de texte présentant un contraste de couleurs insuffisant. Gracieusement mis à disposition par LookZook" aria-labelledby="fig1-caption" aria-describedby="fig1-description" src="/static/images/2019/accessibility/example-of-good-and-bad-color-contrast-lookzook.png" width="600" height="278">
<a href="/static/images/2019/accessibility/example-of-good-and-bad-color-contrast-lookzook.svg">
<img alt="Figure 1. Exemple de texte présentant un contraste de couleurs insuffisant. Gracieusement mis à disposition par LookZook" aria-labelledby="fig1-caption" aria-describedby="fig1-description" src="/static/images/2019/accessibility/example-of-good-and-bad-color-contrast-lookzook.svg" width="568" height="300">
</a>
<div id="fig1-description" class="visually-hidden">Quatre boîtes colorées de nuances orange et grises avec, par-dessus, du texte blanc à l’intérieur créant deux colonnes. La colonne de gauche indique «&nbsp;Trop légèrement coloré&nbsp;» et a la couleur de fond orange écrite comme `#FCA469`. La colonne de droite indique «&nbsp;Recommandé&nbsp;» et la couleur d’arrière-plan orange est écrite comme `#F56905`. La zone supérieure de chaque colonne a un fond orange avec du texte blanc `#FFFFFF` et la zone inférieure a un fond gris avec du texte blanc `#FFFFFF`. Le fond gris montre la couleur orange en niveaux de gris. Gracieusement mis à disposition par LookZook</div>
<div id="fig1-description" class="visually-hidden">Quatre boîtes colorées de nuances marron et grises avec, par-dessus, du texte blanc à l’intérieur créant deux colonnes. La colonne de gauche indique «&nbsp;Trop légèrement coloré&nbsp;» et a la couleur de fond marron écrite comme `#FCA469`. La colonne de droite indique «&nbsp;Recommandé&nbsp;» et la couleur d’arrière-plan marron est écrite comme `#BD5B0E`. La zone supérieure de chaque colonne a un fond marron avec du texte blanc `#FFFFFF` et la zone inférieure a un fond gris avec du texte blanc `#FFFFFF`. Les équivalents en niveaux de gris sont respectivement <code>#B8B8B8</code> et <code>#707070</code>. Gracieusement mis à disposition par LookZook</div>
<figcaption id="fig1-caption">Figure 1. Exemple de texte présentant un contraste de couleurs insuffisant. Gracieusement mis à disposition par LookZook</figcaption>
</figure>

Expand Down
6 changes: 3 additions & 3 deletions src/content/fr/2019/mobile-web.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ Lorsque nous concevons nos sites, nous avons tendance à être dans des conditio
Pour nous aider à surmonter ces problèmes, il existe des [directives d’accessibilité](https://dequeuniversity.com/rules/axe/2.2/color-contrast) que nous pouvons suivre pour choisir nos couleurs de texte et de fond. Comment respectons-nous ces lignes directrices&nbsp;? Seuls 22,04&nbsp;% des sites donnent à l’ensemble de leur texte un contraste de couleur suffisant. Cette valeur est en fait une limite inférieure, car nous n’avons pu analyser que les textes avec un fond plein. Les images et les fonds dégradés n’ont pas pu être analysés.

<figure>
<a href="/static/images/2019/mobile-web/example-of-good-and-bad-color-contrast-lookzook.png">
<img src="/static/images/2019/mobile-web/example-of-good-and-bad-color-contrast-lookzook.png" alt="Figure 4. Exemple de ce à quoi ressemble un texte dont le contraste des couleurs est insuffisant. Avec l’aimable autorisation de LookZook" aria-labelledby="fig4-caption" aria-describedby="fig4-description" width="650" height="300">
<a href="/static/images/2019/mobile-web/example-of-good-and-bad-color-contrast-lookzook.svg">
<img src="/static/images/2019/mobile-web/example-of-good-and-bad-color-contrast-lookzook.svg" alt="Figure 4. Exemple de ce à quoi ressemble un texte dont le contraste des couleurs est insuffisant. Avec l’aimable autorisation de LookZook" aria-labelledby="fig4-caption" aria-describedby="fig4-description" width="568" height="300">
</a>
<div id="fig4-description" class="visually-hidden">Quatre cases colorées de tons orange et gris avec du texte blanc superposé à l’intérieur créant deux colonnes, une où la couleur de fond n’est pas assez colorée par rapport au texte blanc et une où la couleur de fond est recommandée par rapport au texte blanc. Le code hexadécimal de chaque couleur est affiché, le blanc est <code>#FFFFFF</code>, la nuance claire du fond orange est <code>#FCA469</code>, et la nuance recommandée du fond orange est <code>#F56905</code>. Image reproduite avec l’aimable autorisation de LookZook</div>
<div id="fig4-description" class="visually-hidden">Quatre cases colorées de tons marron et gris avec du texte blanc superposé à l’intérieur créant deux colonnes, une où la couleur de fond n’est pas assez colorée par rapport au texte blanc et une où la couleur de fond est recommandée par rapport au texte blanc. Le code hexadécimal de chaque couleur est affiché, le blanc est <code>#FFFFFF</code>, la nuance claire du fond marron est <code>#FCA469</code>, et la nuance recommandée du fond marron est <code>#BD5B0E</code>. Les équivalents en niveaux de gris sont respectivement <code>#B8B8B8</code> et <code>#707070</code>. Image reproduite avec l’aimable autorisation de LookZook</div>
<figcaption id="fig4-caption">Figure 4. Exemple de ce à quoi ressemble un texte dont le contraste des couleurs est insuffisant. Avec l’aimable autorisation de LookZook</figcaption>
</figure>

Expand Down
6 changes: 3 additions & 3 deletions src/content/ja/2019/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ Webページの主な目的はユーザーの興味を引くコンテンツを
このような条件下であっても、あなたのWebサイトが確実に読めるようにするため、テキストと背景で十分な色のコントラストがあることを確認することは重要です。

<figure>
<a href="/static/images/2019/accessibility/example-of-good-and-bad-color-contrast-lookzook.png">
<img alt="図1.色のコントラストが不十分なテキストの表示例 LookZook提供" aria-labelledby="fig1-caption" aria-describedby="fig1-description" src="/static/images/2019/accessibility/example-of-good-and-bad-color-contrast-lookzook.png" width="600" height="278">
<a href="/static/images/2019/accessibility/example-of-good-and-bad-color-contrast-lookzook.svg">
<img alt="図1.色のコントラストが不十分なテキストの表示例 LookZook提供" aria-labelledby="fig1-caption" aria-describedby="fig1-description" src="/static/images/2019/accessibility/example-of-good-and-bad-color-contrast-lookzook.svg" width="568" height="300">
</a>
<div id="fig1-description" class="visually-hidden">オレンジとグレー4色のボックスに白いテキストがあり、2列に並んでいます。左の列は、色の薄い、#FCA469と書かれたオレンジ色の背景色があります。右の列は、推奨と表示されており、オレンジ色の背景色に#F56905と書かれています。各列の上のボックスには白いテキスト#FFFFFFにオレンジ色の背景で、下のボックスは灰色の背景に白いテキスト#FFFFFFとなっています。灰色の背景は、オレンジ色をグレースケールにしたものです。LookZook提供。</div>
<div id="fig1-description" class="visually-hidden">褐色とグレー4色のボックスに白いテキストがあり、2列に並んでいます。左の列は、色の薄い、<code>#FCA469</code>と書かれた褐色色の背景色があります。右の列は、推奨と表示されており、褐色色の背景色に<code>#BD5B0E</code>と書かれています。各列の上のボックスには白いテキスト#FFFFFFに褐色色の背景で、下のボックスは灰色の背景に白いテキスト#FFFFFFとなっています。同等のグレースケールは、それぞれ<code>#B8B8B8</code>および<code>#707070</code>です。LookZook提供。</div>
<figcaption id="fig1-caption">図1.色のコントラストが不十分なテキストの表示例 LookZook提供</figcaption>
</figure>

Expand Down
6 changes: 3 additions & 3 deletions src/content/ja/2019/mobile-web.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ JavaScriptの効果をもっと詳しく知りたい方は、Addy Osmaniの[The
この問題を軽減するために、テキストや背景色を選択する際に従うことのできる[アクセシビリティ・ガイドライン](https://dequeuniversity.com/rules/axe/2.2/color-contrast)があります。では、これらの基準を満たすにはどうすればよいのでしょうか? すべてのテキストに十分な色のコントラストを与えているサイトは22.04%にすぎません。この値は実際には下限値であり、背景が無地のテキストのみを分析したためです。画像やグラデーションの背景は分析できませんでした。

<figure>
<a href="/static/images/2019/mobile-web/example-of-good-and-bad-color-contrast-lookzook.png">
<img src="/static/images/2019/mobile-web/example-of-good-and-bad-color-contrast-lookzook.png" alt="図4. 色のコントラストが不十分なテキストがどのように見えるかの例。提供:LookZook" aria-labelledby="fig4-caption" aria-describedby="fig4-description" width="650" height="300">
<a href="/static/images/2019/mobile-web/example-of-good-and-bad-color-contrast-lookzook.svg">
<img src="/static/images/2019/mobile-web/example-of-good-and-bad-color-contrast-lookzook.svg" alt="図4. 色のコントラストが不十分なテキストがどのように見えるかの例。提供:LookZook" aria-labelledby="fig4-caption" aria-describedby="fig4-description" width="568" height="300">
</a>
<div id="fig4-description" class="visually-hidden">オレンジとグレーの4色のボックスに白のテキストを重ねて、背景色が白のテキストに比べて薄い色になっている場合と、白のテキストに比べて背景色が推奨されている場合の2つの列を作ります。各色の16進数コードが表示され、白は<code>#FFFFFF</code>、オレンジ色の背景の薄い色合いは<code>#FCA469</code>、オレンジ色の背景の推奨色合いは<code>#F56905</code>となっています。画像提供:LookZook</div>
<div id="fig4-description" class="visually-hidden">褐色とグレーの4色のボックスに白のテキストを重ねて、背景色が白のテキストに比べて薄い色になっている場合と、白のテキストに比べて背景色が推奨されている場合の2つの列を作ります。各色の16進数コードが表示され、白は<code>#FFFFFF</code>、褐色色の背景の薄い色合いは<code>#FCA469</code>、褐色色の背景の推奨色合いは<code>#BD5B0E</code>となっています。同等のグレースケールは、それぞれ<code>#B8B8B8</code>および<code>#707070</code>です。画像提供:LookZook</div>
<figcaption id="fig4-caption">図4. 色のコントラストが不十分なテキストがどのように見えるかの例。提供:LookZook</figcaption>
</figure>

Expand Down
Loading

0 comments on commit 358563a

Please sign in to comment.