apca-introduction

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

commit
3cf1a55eac51fcc03e0a47a6ca2af88168363562
parent
ac1b653efe1bc9629c67010ed6db1838f67e5f98
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2022-07-14 19:07
fix wcag definition

https://www.w3.org/WAI/WCAG21/errata/

Diffstat

M wcag2.js 4 ++--

1 files changed, 2 insertions, 2 deletions


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

@@ -1,11 +1,11 @@
    1     1 export const levels = [3, 4.5, 7];
    2     2 
    3     3 var sRGBtoY = function(srgb) {
    4    -1   var pre = c => c < 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
   -1     4   var pre = c => c < 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
    5     5   var r = pre(srgb[0] / 255);
    6     6   var g = pre(srgb[1] / 255);
    7     7   var b = pre(srgb[2] / 255);
    8    -1   return 0.2126729 * r + 0.7151522 * g + 0.0721750 * b;
   -1     8   return 0.2126 * r + 0.7152 * g + 0.0722 * b;
    9     9 };
   10    10 
   11    11 export var contrast = function(fg, bg) {