From cdffd7c47b366dab30df53cd340c16469943a83e Mon Sep 17 00:00:00 2001 From: Zeno Kapitein Date: Fri, 4 Apr 2025 18:00:01 +0200 Subject: [PATCH] Desaturate text colours by decreasing chroma for the last steps of the color scale (#3096) --- .changeset/moody-jeans-explain.md | 5 +++++ packages/colors/src/transformations.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/moody-jeans-explain.md diff --git a/.changeset/moody-jeans-explain.md b/.changeset/moody-jeans-explain.md new file mode 100644 index 000000000..0448d2aab --- /dev/null +++ b/.changeset/moody-jeans-explain.md @@ -0,0 +1,5 @@ +--- +"@gitbook/colors": patch +--- + +Desaturate text colors by decreasing chroma for the last steps of the color scale diff --git a/packages/colors/src/transformations.ts b/packages/colors/src/transformations.ts index ab0e25c31..bf7f770c0 100644 --- a/packages/colors/src/transformations.ts +++ b/packages/colors/src/transformations.ts @@ -220,7 +220,7 @@ export function colorScale( continue; } - const chromaRatio = index < 8 ? index * 0.05 : 1; + const chromaRatio = index === 8 || index === 9 ? 1 : index * 0.05; const shade = { L: targetL, // Blend lightness