setBlendMode

open fun setBlendMode(@NonNull paint: @NonNull Paint, @Nullable blendMode: @Nullable BlendModeCompat): Boolean(source)

Configure the corresponding BlendMode on the given paint. If the Android platform supports the blend mode natively, it will fall back on the framework implementation of either BlendMode or PorterDuff mode. If it is not supported then this method is a no-op

Return

true if the specified BlendMode as applied successfully, false if the platform version does not support this BlendMode. If the BlendMode is not supported, this falls back to the default BlendMode

Parameters

paint

target Paint to which the BlendMode will be applied

blendMode

BlendMode to configure on the paint if it is supported by the platform version. A value of null removes the BlendMode from the Paint and restores it to the default