orTransparent

fun Color?.orTransparent(defaultValue: Color = Color.Transparent): Color

Color Extension to show the original Color that we pass from the extension or in case of being null we will pass a default value. This default value can be the value you want or the defined one (this would be Color.Transparent)

Parameters

defaultValue

Color the value we want in case the Color is null, by default it will be Color.Transparent)

See also