Skip to content

Commit 97c1ad7

Browse files
authored
Renamed contrast check function
1 parent d7b44fb commit 97c1ad7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/documentation/src/components/ColorsAndTheming/ThemeBuilder/useThemeVariables.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface CSSVariable {
1212
value: CSSVariableValue;
1313
}
1414

15-
function isBestColorWhite(color: HexString): boolean {
15+
function isWhiteHighestContrast(color: HexString): boolean {
1616
const lightRatio = getContrastRatio(color, "#fff");
1717
const darkRatio = getContrastRatio(color, "#000");
1818

@@ -43,7 +43,7 @@ export default function useThemeVariables(
4343
];
4444

4545
if (primaryColor) {
46-
if (isBestColorWhite(primaryColor)) {
46+
if (isWhiteHighestContrast(primaryColor)) {
4747
variables.push({
4848
name: "--rmd-theme-on-primary",
4949
value: "#fff",
@@ -52,7 +52,7 @@ export default function useThemeVariables(
5252
}
5353

5454
if (secondaryColor) {
55-
if (isBestColorWhite(secondaryColor)) {
55+
if (isWhiteHighestContrast(secondaryColor)) {
5656
variables.push({
5757
name: "--rmd-theme-on-secondary",
5858
value: "#fff",

0 commit comments

Comments
 (0)