Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

BlendModeColorFilterCompat

open class BlendModeColorFilterCompat
kotlin.Any
   ↳ androidx.core.graphics.BlendModeColorFilterCompat

Helper for accessing ColorFilter APIs on various API levels of the platform

Summary

Public methods

open static ColorFilter?
createBlendModeColorFilterCompat(color: Int, @NonNull blendModeCompat: BlendModeCompat)

Convenience method to create ColorFilter in a backward compatible way.

Public methods

createBlendModeColorFilterCompat

@Nullable open static fun createBlendModeColorFilterCompat(color: Int, @NonNull blendModeCompat: BlendModeCompat): ColorFilter?

Convenience method to create ColorFilter in a backward compatible way. This method falls back on PorterDuffColorFilter for API levels that do not support BlendModeColorFilter. This method returns null if the BlendMode provided is not supported on a given API level.