Skip to content

Commit c3f6b8c

Browse files
authored
Reduce chroma of text layers (#3188)
1 parent 0e201d5 commit c3f6b8c

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.changeset/eight-vans-judge.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@gitbook/colors": patch
3+
---
4+
5+
Update chroma ratio per step

packages/colors/src/transformations.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,21 @@ export function colorScale(
220220
continue;
221221
}
222222

223-
const chromaRatio = index === 8 || index === 9 ? 1 : index * 0.05;
223+
const chromaRatio = (() => {
224+
switch (index) {
225+
// Step 9 and 10 have max chroma, meaning they are fully saturated.
226+
case 8:
227+
case 9:
228+
return 1;
229+
// Step 11 and 12 have a reduced chroma
230+
case 10:
231+
return 0.4;
232+
case 11:
233+
return 0.1;
234+
default:
235+
return index * 0.05;
236+
}
237+
})();
224238

225239
const shade = {
226240
L: targetL, // Blend lightness

0 commit comments

Comments
 (0)