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
|
fun Boolean.toInt() = if (this) 1 else 0
|
||||||
private fun isDark(color: Int): Boolean {
|
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 {
|
private fun pixelIsClose(color1: Int, color2: Int): Boolean {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user