kutils / com.celites.kutils / android.graphics.drawable.Drawable

Extensions for android.graphics.drawable.Drawable

applyTinting

fun Drawable.applyTinting(color: Int): Drawable

Apply Tint to drawable, this method returns a drawable that you have to use when you need tinted drawable.

fun Drawable.applyTinting(colorRes: Int, context: Context): Drawable

Apply Tint to drawable, where color is pointed from Resource. This method returns a drawable that you have to use when you need tinted drawable.

toBitmap

fun Drawable.toBitmap(resources: Resources): Bitmap

Get Bitmap from receiver. Caution: This method isn't tested with vector drawable.