disable the eyedropper if a brush or bg color is picked

This commit is contained in:
tibbi 2021-12-29 10:41:38 +01:00
parent 4dec99bc9d
commit 9ff0c7e5c7
1 changed files with 8 additions and 0 deletions

View File

@ -519,12 +519,20 @@ class MainActivity : SimpleActivity(), CanvasListener {
private fun pickColor() {
ColorPickerDialog(this, color) { wasPositivePressed, color ->
if (wasPositivePressed) {
if (isEyeDropperOn) {
eyeDropperClicked()
}
setColor(color)
}
}
}
fun setBackgroundColor(pickedColor: Int) {
if (isEyeDropperOn) {
eyeDropperClicked()
}
val contrastColor = pickedColor.getContrastColor()
undo.applyColorFilter(contrastColor)
eraser.applyColorFilter(contrastColor)