Revert "Merge pull request #2376 from Davidster/fix_palette_readable_color_contrast"
This reverts commit63042354fc, reversing changes made to31d1d5fecb.
This commit is contained in:
parent
0a61bcf24c
commit
efa75607ba
1 changed files with 2 additions and 10 deletions
|
|
@ -612,19 +612,11 @@ fn mix(a: Color, b: Color, factor: f32) -> Color {
|
||||||
|
|
||||||
fn readable(background: Color, text: Color) -> Color {
|
fn readable(background: Color, text: Color) -> Color {
|
||||||
if is_readable(background, text) {
|
if is_readable(background, text) {
|
||||||
return text;
|
text
|
||||||
}
|
} else if is_dark(background) {
|
||||||
|
|
||||||
let fallback = if is_dark(background) {
|
|
||||||
Color::WHITE
|
Color::WHITE
|
||||||
} else {
|
} else {
|
||||||
Color::BLACK
|
Color::BLACK
|
||||||
};
|
|
||||||
|
|
||||||
if is_readable(background, fallback) {
|
|
||||||
fallback
|
|
||||||
} else {
|
|
||||||
fallback.inverse()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue