apca-introduction

The missing introduction to APCA  https://p.ce9e.org/apca-introduction/
git clone https://git.ce9e.org/apca-introduction.git

commit
f43b4ccf7aafcd5d4cc3aefddb42fe3afebc0f51
parent
4ec0dadfd1529e5c51bf5a2e80cf08ae9e7406cc
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2022-08-06 08:09
rm misleading conformence level labels from examples

Diffstat

M examples/examples.js 7 ++++---
M examples/screenshot.png 0

2 files changed, 4 insertions, 3 deletions


diff --git a/examples/examples.js b/examples/examples.js

@@ -1,7 +1,8 @@
    1     1 import * as wcag from '../wcag2.js';
    2     2 import * as apca from '../apca.js';
    3     3 
    4    -1 const LEVEL_LABELS = ['×', 'A', 'AA', 'AAA'];
   -1     4 const WCAG_LABELS = ['×', '> 3', '> 4.5', '> 7'];
   -1     5 const APCA_LABELS = ['×', '> 45', '> 60', '> 75'];
    5     6 
    6     7 const COLORS = [
    7     8 	['#888888', '#000000', '#ffffff'],
@@ -44,13 +45,13 @@ var addExample = function(fg, bg) {
   44    45 	var wcag_contrast = wcag.contrast(cfg, cbg);
   45    46 	var wcag_level = getLevel(wcag_contrast, wcag);
   46    47 	clone.querySelector('.wcag output').textContent = wcag.abs(wcag_contrast).toFixed(1);
   47    -1 	clone.querySelector('.wcag .badge').textContent = LEVEL_LABELS[wcag_level];
   -1    48 	clone.querySelector('.wcag .badge').textContent = WCAG_LABELS[wcag_level];
   48    49 	clone.querySelector('.wcag .badge').classList.add(`badge-${wcag_level}`);
   49    50 
   50    51 	var apca_contrast = apca.contrast(cfg, cbg);
   51    52 	var apca_level = getLevel(apca_contrast, apca);
   52    53 	clone.querySelector('.apca output').textContent = apca_contrast.toFixed(0);
   53    -1 	clone.querySelector('.apca .badge').textContent = LEVEL_LABELS[apca_level];
   -1    54 	clone.querySelector('.apca .badge').textContent = APCA_LABELS[apca_level];
   54    55 	clone.querySelector('.apca .badge').classList.add(`badge-${apca_level}`);
   55    56 
   56    57 	document.body.append(clone);

diff --git a/examples/screenshot.png b/examples/screenshot.png

Binary files differ.