add a drawable extension for applying color filter

This commit is contained in:
tibbi 2017-10-07 18:00:18 +02:00
parent db016cad04
commit 735dfd2054

View file

@ -0,0 +1,6 @@
package com.simplemobiletools.commons.extensions
import android.graphics.PorterDuff
import android.graphics.drawable.Drawable
fun Drawable.applyColorFilter(color: Int) = mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN)