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 @@ -389,17 +389,17 @@ export class DarkModeTheme implements ColorModeTheme {
const color = this.seedColor.clone();

// Adjusted version of bgAccentSubtle (less or no chroma)
if (this.seedLightness > 0.25) {
color.oklch.l = 0.25;
if (this.seedLightness > 0.29) {
color.oklch.l = 0.29;
}

// If the color is too dark it won't be visible against bg.
if (this.seedLightness < 0.22) {
color.oklch.l = 0.22;
}

if (this.seedChroma > 0.015) {
color.oklch.c = 0.015;
if (this.seedChroma > 0.025) {
color.oklch.c = 0.025;
}

if (this.seedIsAchromatic) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ describe("bgNeutralSubtle color", () => {
const { bgNeutralSubtle } = new DarkModeTheme(
"oklch(0.3 0.03 170)",
).getColors();
expect(bgNeutralSubtle).toEqual("rgb(13.15% 13.15% 13.15%)");
expect(bgNeutralSubtle).toEqual("rgb(16.952% 16.952% 16.952%)");
});

it("should return correct color when lightness < 0.2", () => {
Expand All @@ -297,14 +297,14 @@ describe("bgNeutralSubtle color", () => {
const { bgNeutralSubtle } = new DarkModeTheme(
"oklch(0.3 0.03 170)",
).getColors();
expect(bgNeutralSubtle).toEqual("rgb(13.15% 13.15% 13.15%)");
expect(bgNeutralSubtle).toEqual("rgb(16.952% 16.952% 16.952%)");
});

it("should return correct color when chroma < 0.025 (achromatic)", () => {
const { bgNeutralSubtle } = new DarkModeTheme(
"oklch(0.3 0.01 170)",
).getColors();
expect(bgNeutralSubtle).toEqual("rgb(13.15% 13.15% 13.15%)");
expect(bgNeutralSubtle).toEqual("rgb(16.952% 16.952% 16.952%)");
});
});

Expand All @@ -313,7 +313,7 @@ describe("bgNeutralSubtleHover color", () => {
const { bgNeutralSubtleHover } = new DarkModeTheme(
"oklch(0.3 0.01 170)",
).getColors();
expect(bgNeutralSubtleHover).toEqual("rgb(15.988% 15.988% 15.988%)");
expect(bgNeutralSubtleHover).toEqual("rgb(19.892% 19.892% 19.892%)");
});
});

Expand All @@ -322,7 +322,7 @@ describe("bgNeutralSubtleActive color", () => {
const { bgNeutralSubtleActive } = new DarkModeTheme(
"oklch(0.3 0.01 170)",
).getColors();
expect(bgNeutralSubtleActive).toEqual("rgb(11.304% 11.304% 11.304%)");
expect(bgNeutralSubtleActive).toEqual("rgb(15.033% 15.033% 15.033%)");
});
});

Expand Down