Color the icon itself, not the background

This commit is contained in:
Naveen 2022-10-12 03:14:12 +05:30
parent 5be7d50402
commit 2fecf237a3

View file

@ -40,6 +40,7 @@ import java.io.ByteArrayOutputStream
import java.io.File import java.io.File
import java.io.OutputStream import java.io.OutputStream
class MainActivity : SimpleActivity(), CanvasListener { class MainActivity : SimpleActivity(), CanvasListener {
private val PICK_IMAGE_INTENT = 1 private val PICK_IMAGE_INTENT = 1
private val SAVE_IMAGE_INTENT = 2 private val SAVE_IMAGE_INTENT = 2
@ -416,16 +417,10 @@ class MainActivity : SimpleActivity(), CanvasListener {
).forEach { ).forEach {
val view = it.first val view = it.first
val enabled = it.second val enabled = it.second
if (enabled) {
view.apply { view.applyColorFilter(getProperPrimaryColor())
if (enabled) { } else {
val primaryColor = getProperPrimaryColor() view.applyColorFilter(config.canvasBackgroundColor.getContrastColor())
background = ColorDrawable(primaryColor).apply { alpha = 220 }
applyColorFilter(primaryColor.getContrastColor())
} else {
background = null
applyColorFilter(config.canvasBackgroundColor.getContrastColor())
}
} }
} }
} }