From 046f4982951703397995fb93a80a82e526f06611 Mon Sep 17 00:00:00 2001 From: ginnyTheCat Date: Sun, 11 Oct 2020 00:37:00 +0200 Subject: [PATCH] Added formula sources --- src/utils/colour.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/colour.ts b/src/utils/colour.ts index 5fb422c61c..10c18dbfe7 100644 --- a/src/utils/colour.ts +++ b/src/utils/colour.ts @@ -45,6 +45,9 @@ function generateAB(hue: number, chroma: number): [number, number] { } function labToRGB(l: number, a: number, b: number): [number, number, number] { + // https://en.wikipedia.org/wiki/CIELAB_color_space#Reverse_transformation + // https://en.wikipedia.org/wiki/SRGB#The_forward_transformation_(CIE_XYZ_to_sRGB) + // Convert CIELAB to CIEXYZ (D65) let y = (l + 16) / 116; const x = adjustXYZ(y + a / 500) * 0.9505;