Chore: cleanup
This commit is contained in:
parent
f2b3e73212
commit
e12bec0b13
1 changed files with 6 additions and 3 deletions
|
@ -50,14 +50,17 @@ fn generate_color(
|
||||||
unlike: Option<(u8, u8, u8)>,
|
unlike: Option<(u8, u8, u8)>,
|
||||||
) -> (u8, u8, u8) {
|
) -> (u8, u8, u8) {
|
||||||
let criteria = |(r, g, b): (u8, u8, u8)| {
|
let criteria = |(r, g, b): (u8, u8, u8)| {
|
||||||
if dark_mode && (r as u16 + g as u16 + b as u16) < 100 {
|
let r = r as u16;
|
||||||
|
let g = g as u16;
|
||||||
|
let b = b as u16;
|
||||||
|
if dark_mode && (r + g + b) < 100 {
|
||||||
return false;
|
return false;
|
||||||
} else if !dark_mode && (r as u16 + g as u16 + b as u16) > 600 {
|
} else if !dark_mode && (r + g + b) > 600 {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some((r1, g1, b1)) = unlike {
|
if let Some((r1, g1, b1)) = unlike {
|
||||||
if (r.abs_diff(r1) as u16 + g.abs_diff(g1) as u16 + b.abs_diff(b1) as u16) < 200 {
|
if (r.abs_diff(r1 as u16) + g.abs_diff(g1 as u16) + b.abs_diff(b1 as u16)) < 200 {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue