colour contrast (WCAG): fix bug
colour contrast (WCAG): fix bug: a task in smol-software-harbor (Harbor dataset). Contrast ratios of very dark colours come out wrong in src/contrast.js ( ratio(' 000000', ' 080808') should be 1.05). The sRGB channel conversion forgot the linear segment of the WCAG formula: channel values c <=…
The task
Contrast ratios of very dark colours come out wrong in `src/contrast.js` (`ratio('#000000', '#080808')` should be 1.05). The sRGB channel conversion forgot the linear segment of the WCAG formula: channel values `c <= 0.03928` (after dividing by 255) are converted as `c / 12.92`. Fix it and run `node --test…
Part of efederici/smol-software-harbor.