mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 19:55:11 +01:00
Checking alpha component when check if a color is dark
Because turns out some scanalors leave an uncropped alpha in their pages
This commit is contained in:
parent
a2e7b48501
commit
beeabe17c4
@ -206,7 +206,8 @@ object ImageUtil {
|
||||
|
||||
fun Boolean.toInt() = if (this) 1 else 0
|
||||
private fun isDark(color: Int): Boolean {
|
||||
return Color.red(color) < 40 && Color.blue(color) < 40 && Color.green(color) < 40
|
||||
return Color.red(color) < 40 && Color.blue(color) < 40 && Color.green(color) < 40 &&
|
||||
Color.alpha(color) > 200
|
||||
}
|
||||
|
||||
private fun pixelIsClose(color1: Int, color2: Int): Boolean {
|
||||
|
Loading…
Reference in New Issue
Block a user