Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -763,15 +763,20 @@ export class DarkModeTheme implements ColorModeTheme {
// Neutral foreground. Slightly less prominent than main fg
const color = this.fg.clone();

color.oklch.c = 0;
color.oklch.l -= 0.05;
color.oklch.c -= 0.04;

if (color.oklch.c < 0) {
color.oklch.c = 0;
}

return color;
}

private get fgNeutralSubtle() {
const color = this.fgNeutral.clone();

color.oklch.l -= 0.3;
color.oklch.l -= 0.2;

return color;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -767,15 +767,20 @@ export class LightModeTheme implements ColorModeTheme {
// Neutral foreground. Slightly less prominent than main fg
const color = this.fg.clone();

color.oklch.c -= 0.09;
color.oklch.l += 0.05;
color.oklch.c -= 0.02;

if (color.oklch.c < 0) {
color.oklch.c = 0;
}

return color;
}

private get fgNeutralSubtle() {
const color = this.fgNeutral.clone();

color.oklch.l += 0.22;
color.oklch.l += 0.12;

return color;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,19 +638,19 @@ describe("fgNeutral color", () => {
it("should return correct color when chroma < 0.04", () => {
const { fgNeutral } = new DarkModeTheme("oklch(0.45 0.03 60)").getColors();

expect(fgNeutral).toEqual("rgb(88.268% 88.268% 88.268%)");
expect(fgNeutral).toEqual("rgb(81.873% 81.873% 81.873%)");
});

it("should return correct color when chroma > 0.04 and hue is between 120 and 300", () => {
const { fgNeutral } = new DarkModeTheme("oklch(0.45 0.1 150)").getColors();

expect(fgNeutral).toEqual("rgb(88.268% 88.268% 88.268%)");
expect(fgNeutral).toEqual("rgb(77.671% 83.881% 78.629%)");
});

it("should return correct color when chroma > 0.04 and hue is not between 120 and 300", () => {
const { fgNeutral } = new DarkModeTheme("oklch(0.45 0.1 110)").getColors();

expect(fgNeutral).toEqual("rgb(88.268% 88.268% 88.268%)");
expect(fgNeutral).toEqual("rgb(82.157% 82.637% 75.397%)");
});
});

Expand All @@ -660,7 +660,7 @@ describe("fgNeutralSubtle color", () => {
"oklch(0.45 0.03 60)",
).getColors();

expect(fgNeutralSubtle).toEqual("rgb(51.374% 51.374% 51.374%)");
expect(fgNeutralSubtle).toEqual("rgb(57.26% 57.26% 57.26%)");
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -670,19 +670,19 @@ describe("fgNeutral color", () => {
it("should return correct color when chroma < 0.04", () => {
const { fgNeutral } = new LightModeTheme("oklch(0.45 0.03 60)").getColors();

expect(fgNeutral).toEqual("rgb(0% 26.839% 41.548%)");
expect(fgNeutral).toEqual("rgb(30.171% 30.171% 30.171%)");
});

it("should return correct color when chroma > 0.04 and hue is between 120 and 300", () => {
const { fgNeutral } = new LightModeTheme("oklch(0.45 0.1 150)").getColors();

expect(fgNeutral).toEqual("rgb(31.034% 21.083% 30.044%)");
expect(fgNeutral).toEqual("rgb(27.457% 31.431% 28.097%)");
});

it("should return correct color when chroma > 0.04 and hue is not between 120 and 300", () => {
const { fgNeutral } = new LightModeTheme("oklch(0.45 0.1 110)").getColors();

expect(fgNeutral).toEqual("rgb(24.783% 23.161% 34.901%)");
expect(fgNeutral).toEqual("rgb(30.362% 30.64% 26.009%)");
});
});

Expand All @@ -692,7 +692,7 @@ describe("fgNeutralSubtle color", () => {
"oklch(0.45 0.03 60)",
).getColors();

expect(fgNeutralSubtle).toEqual("rgb(27.658% 51.819% 68%)");
expect(fgNeutralSubtle).toEqual("rgb(43.337% 43.337% 43.337%)");
});
});

Expand Down
Loading