Skip to content

Commit 99166a6

Browse files
committed
refactor(client-runtime): drop badge foreground doc comment to match comment prune
1 parent 48bca3c commit 99166a6

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

‎packages/client-runtime/src/state/providerInstanceDisplay.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ export function normalizeProviderAccentColor(value: string | undefined): string
4242
return /^#[0-9a-fA-F]{6}$/u.test(trimmed) ? trimmed : undefined;
4343
}
4444

45-
/**
46-
* Text color for initials drawn on an accent-color badge: black or white,
47-
* whichever has the higher WCAG contrast against the accent, so light accents
48-
* stay readable. An invalid accent keeps the white default.
49-
*/
5045
export function providerAccentForegroundColor(accentColor: string): "#000000" | "#ffffff" {
5146
const hex = normalizeProviderAccentColor(accentColor);
5247
if (!hex) return "#ffffff";
@@ -56,7 +51,7 @@ export function providerAccentForegroundColor(accentColor: string): "#000000" |
5651
};
5752
const luminance =
5853
0.2126 * linearChannel(1) + 0.7152 * linearChannel(3) + 0.0722 * linearChannel(5);
59-
// Black wins when (L + 0.05) / 0.05 exceeds 1.05 / (L + 0.05).
54+
// WCAG contrast: black wins when (L + 0.05) / 0.05 exceeds 1.05 / (L + 0.05).
6055
return (luminance + 0.05) ** 2 > 0.0525 ? "#000000" : "#ffffff";
6156
}
6257

0 commit comments

Comments
 (0)