diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/theme/palette.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/core/src/theme/palette.rs b/core/src/theme/palette.rs index 91543567..ca91c248 100644 --- a/core/src/theme/palette.rs +++ b/core/src/theme/palette.rs @@ -612,19 +612,11 @@ fn mix(a: Color, b: Color, factor: f32) -> Color { fn readable(background: Color, text: Color) -> Color { if is_readable(background, text) { - return text; - } - - let fallback = if is_dark(background) { + text + } else if is_dark(background) { Color::WHITE } else { Color::BLACK - }; - - if is_readable(background, fallback) { - fallback - } else { - fallback.inverse() } } |