Skip to content

Commit

Permalink
Revert "Merge pull request #2376 from Davidster/fix_palette_readable_…
Browse files Browse the repository at this point in the history
…color_contrast"

This reverts commit 6304235, reversing
changes made to 31d1d5f.
  • Loading branch information
hecrj committed Apr 7, 2024
1 parent 0a61bcf commit efa7560
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions core/src/theme/palette.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit efa7560

Please sign in to comment.