This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright Simula Research Laboratory 2018 | |
// Licenced under BSD-3 | |
// This follows https://www.w3.org/TR/WCAG20-TECHS/G17.html | |
function transValue(value: number) { | |
if value <= 0.03928{ | |
return value / 12.92; | |
} else { | |
return Math.pow((RsRGB + 0.055) / 1.055, 2.4); |