chore: add js-doc (#275)

This commit is contained in:
doprz
2024-10-07 23:06:35 -05:00
committed by GitHub
parent 668c8d0075
commit b3632c0196
7 changed files with 22 additions and 5 deletions

View File

@@ -207,9 +207,9 @@ export function getUnusedColor(
}
// OKLab helper functions (https://github.com/bottosson/bottosson.github.io/blob/master/misc/colorpicker/colorconversion.js)
function srgbTransferFunction(a: number): number {
return a <= 0.0031308 ? 12.92 * a : 1.055 * a ** 0.4166666666666667 - 0.055;
}
// function srgbTransferFunction(a: number): number {
// return a <= 0.0031308 ? 12.92 * a : 1.055 * a ** 0.4166666666666667 - 0.055;
// }
function srgbTransferFunctionInv(a: number): number {
return a > 0.04045 ? ((a + 0.055) / 1.055) ** 2.4 : a / 12.92;