mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-15 10:43:21 +02:00
Apply suggestion from @silverwind
Signed-off-by: silverwind <me@silverwind.io>
This commit is contained in:
parent
21782d1259
commit
fedb2955e3
@ -12,8 +12,7 @@ function useLightText(backgroundColor: AnyColor): boolean {
|
|||||||
return getRelativeLuminance(backgroundColor) < 0.453;
|
return getRelativeLuminance(backgroundColor) < 0.453;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Given a background color, returns a black or white foreground color that the highest
|
/** Given a background color, returns a black or white foreground color with the highest contrast ratio. */
|
||||||
* contrast ratio. */
|
|
||||||
// In the future, the APCA contrast function, or CSS `contrast-color` will be better.
|
// 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
|
// https://github.com/color-js/color.js/blob/eb7b53f7a13bb716ec8b28c7a56f052cd599acd9/src/contrast/APCA.js#L42
|
||||||
export function contrastColor(backgroundColor: AnyColor): string {
|
export function contrastColor(backgroundColor: AnyColor): string {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user