Skip to content

Commit 7b391e8

Browse files
committed
Neutralize blue backgrounds
1 parent 99bfb44 commit 7b391e8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/generators/modify-colors.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ function modifyBgHSL({h, s, l, a}) {
7979
const lMaxS1 = 0.4;
8080
const sNeutralLim = 0.12;
8181
const lNeutralLight = 0.8;
82-
const sColored = 0.10;
82+
const sColored = 0.05;
8383
const hColored = 205;
84+
const hBlue0 = 200;
85+
const hBlue1 = 280;
8486

8587
const lMax = scale(s, 0, 1, lMaxS0, lMaxS1);
8688
const lx = (l < lMax ?
@@ -89,7 +91,7 @@ function modifyBgHSL({h, s, l, a}) {
8991
lMax :
9092
scale(l, 0.5, 1, lMax, lMin));
9193

92-
const isNeutral = l >= lNeutralLight || s < sNeutralLim;
94+
const isNeutral = (l >= lNeutralLight && h > hBlue0 && h < hBlue1) || s < sNeutralLim;
9395
let hx = h;
9496
let sx = s;
9597
if (isNeutral) {

0 commit comments

Comments
 (0)