Reduce chroma of text layers (#3188)

This commit is contained in:
Zeno Kapitein
2025-04-29 19:29:42 +02:00
committed by GitHub
parent 0e201d5899
commit c3f6b8c003
2 changed files with 20 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@gitbook/colors": patch
---
Update chroma ratio per step
+15 -1
View File
@@ -220,7 +220,21 @@ export function colorScale(
continue; continue;
} }
const chromaRatio = index === 8 || index === 9 ? 1 : index * 0.05; const chromaRatio = (() => {
switch (index) {
// Step 9 and 10 have max chroma, meaning they are fully saturated.
case 8:
case 9:
return 1;
// Step 11 and 12 have a reduced chroma
case 10:
return 0.4;
case 11:
return 0.1;
default:
return index * 0.05;
}
})();
const shade = { const shade = {
L: targetL, // Blend lightness L: targetL, // Blend lightness