apca-introduction

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

commit
f0bae95c61153505e7a7f524a3d219c09fd7a1f1
parent
acdb62f96becd7115e9d0f0e921aaef56b01d026
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2022-07-17 05:48
add more level colors

Diffstat

M apca.js 2 +-
M tool/tool.js 3 +++
M wcag2.js 2 +-

3 files changed, 5 insertions, 2 deletions


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

@@ -1,4 +1,4 @@
    1    -1 export const levels = [45, 60, 75];
   -1     1 export const levels = [15, 30, 45, 60, 75, 90];
    2     2 
    3     3 const tests = [
    4     4   [[136, 136, 136], [255, 255, 255], 63.056469930209424],

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

@@ -73,9 +73,12 @@ var score = function(range, levels) {
   73    73 var makeGradient = function(scores) {
   74    74   const colors = [
   75    75     'hsl(0, 100%, 40%)',
   -1    76     'hsl(13, 100%, 45%)',
   -1    77     'hsl(26, 100%, 45%)',
   76    78     'hsl(40, 100%, 45%)',
   77    79     'hsl(80, 60%, 45%)',
   78    80     'hsl(95, 60%, 41%)',
   -1    81     'hsl(-70, 80%, 40%)',
   79    82   ];
   80    83 
   81    84   var stops = [];

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

@@ -1,4 +1,4 @@
    1    -1 export const levels = [3, 4.5, 7];
   -1     1 export const levels = [3, 3, 3, 4.5, 7, 100];
    2     2 
    3     3 var sRGBtoY = function(srgb) {
    4     4   var pre = c => c < 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);