0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-02-23 04:18:07 +01:00

Apply suggestion from @silverwind

Signed-off-by: silverwind <me@silverwind.io>
This commit is contained in:
silverwind 2026-02-19 06:48:46 +01:00 committed by GitHub
parent 21782d1259
commit fedb2955e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,8 +12,7 @@ function useLightText(backgroundColor: AnyColor): boolean {
return getRelativeLuminance(backgroundColor) < 0.453;
}
/** Given a background color, returns a black or white foreground color that the highest
* contrast ratio. */
/** Given a background color, returns a black or white foreground color with the highest contrast ratio. */
// In the future, the APCA contrast function, or CSS `contrast-color` will be better.
// https://github.com/color-js/color.js/blob/eb7b53f7a13bb716ec8b28c7a56f052cd599acd9/src/contrast/APCA.js#L42
export function contrastColor(backgroundColor: AnyColor): string {