- commit
- 3cb0bc7270de561799d6588384b5955d6f289087
- parent
- 5ba42ff5d2aeeec02a2d4c98ddd0626e092c718a
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2022-07-20 07:16
compare APCA to itself with inverted fg/bg
Diffstat
| M | analysis.md | 17 | +++++++++++++++++ |
| M | plots/coverage.py | 7 | ++++++- |
2 files changed, 23 insertions, 1 deletions
diff --git a/analysis.md b/analysis.md
@@ -419,6 +419,23 @@ the APCA thresholds. As expected, most color pairs fall into the same category 419 419 with both formulas. For example, only 1.7 % pass the modified WCAG 2.x with a 420 420 contrast above 3.8, but fail APCA with a contrast below 45. 421 421 -1 422 | | < 15 | 15-30 | 30-45 | 45-60 | 60-75 | 75-90 | > 90 | total | -1 423 | ------:| -----:| -----:| -----:| -----:| -----:| -----:| -----:| -----:| -1 424 | < 15 | 33.6 | 1.3 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 34.9 | -1 425 | 15-30 | 1.3 | 23.1 | 1.3 | 0.0 | 0.0 | 0.0 | 0.0 | 25.7 | -1 426 | 30-45 | 0.0 | 1.4 | 16.5 | 1.1 | 0.0 | 0.0 | 0.0 | 18.9 | -1 427 | 45-60 | 0.0 | 0.0 | 1.2 | 10.4 | 0.7 | 0.0 | 0.0 | 12.3 | -1 428 | 60-75 | 0.0 | 0.0 | 0.0 | 0.8 | 5.2 | 0.3 | 0.0 | 6.2 | -1 429 | 75-90 | 0.0 | 0.0 | 0.0 | 0.0 | 0.3 | 1.5 | 0.0 | 1.8 | -1 430 | > 90 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.1 | 0.1 | -1 431 | total | 34.9 | 25.8 | 18.9 | 12.3 | 6.2 | 1.8 | 0.1 | | -1 432 -1 433 The third table compares APCA to itself, but with foreground and background -1 434 switched. WCAG 2.x does not make a difference between foreground and -1 435 background, so this comparison would be pointless there. APCA on the other hand -1 436 uses different exponents for foreground and background. This table shows that -1 437 this does have a small but still significant impact on the results. -1 438 422 439 ## Conclusion 423 440 424 441 In this analysis I took a deeper look at the Accessible Perceptual Contrast
diff --git a/plots/coverage.py b/plots/coverage.py
@@ -76,13 +76,18 @@ if __name__ == '__main__': 76 76 apca_yfg = apca_y(fg) 77 77 apca_ybg = apca_y(bg) 78 78 apca = apca_contrast(apca_yfg, apca_ybg) -1 79 apcai = apca_contrast(apca_ybg, apca_yfg) 79 80 80 81 wcag_yfg = wcag_y(fg) 81 82 wcag_ybg = wcag_y(bg) 82 83 wcag = wcag_contrast(wcag_yfg, wcag_ybg) 83 84 wcag4 = wcag_contrast(wcag_yfg, wcag_ybg, 0.4) 84 8585 -1 for _wcag, wcag_levels in [(wcag, WCAG_LEVELS), (wcag4, WCAG4_LEVELS)]:-1 86 for _wcag, wcag_levels in [ -1 87 (wcag, WCAG_LEVELS), -1 88 (wcag4, WCAG4_LEVELS), -1 89 (apcai, APCA_LEVELS), -1 90 ]: 86 91 rows = [] 87 92 for wcag_lower, wcag_upper in iter_levels(wcag_levels): 88 93 rows.append([])