Closed MatthewCallery closed 1 year ago
Using a PNG drawable to create a custom DrawableShape with tint = false results in the drawable being displayed as though a white tint has been applied (see video below along with the PNG file I'm using).
DrawableShape
tint = false
Device: moto g31(w) Android version: 11 Konfetti: nl.dionsegijn:konfetti-compose:2.0.2
nl.dionsegijn:konfetti-compose:2.0.2
@Composable fun EmojiRain( @DrawableRes drawables: List<Int>, onEnd: (() -> Unit)?, modifier: Modifier = Modifier ) { val shapes = drawables.mapNotNull { ContextCompat.getDrawable(LocalContext.current, it)?.let { drawable -> Shape.DrawableShape(drawable = drawable, tint = false) } } KonfettiView( parties = listOf( Party( angle = Angle.BOTTOM, spread = 1, rotation = Rotation( enabled = true, multiplier2D = 1f, multiplier3D = 0f, ), speed = 1f, maxSpeed = 6f, damping = 1f, timeToLive = 2000L, size = (12..42 step 6).map { Size(it) }, shapes = shapes, emitter = Emitter(duration = 2, TimeUnit.SECONDS).perSecond(10), position = Position .Relative(0.0, 0.0) .between(Position.Relative(1.0, 0.0)), ) ), updateListener = object : OnParticleSystemUpdateListener { override fun onParticleSystemEnded(system: PartySystem, activeSystems: Int) { onEnd?.invoke() } }, modifier = modifier, ) }
https://user-images.githubusercontent.com/13498475/168575719-75eff0e2-d48d-44ef-a386-55f7ee898a92.mp4
I have a fix for this. I'll submit a PR
A PR has been merged addressing this issue
Fixes has been released in version 2.0.3
Using a PNG drawable to create a custom
DrawableShape
withtint = false
results in the drawable being displayed as though a white tint has been applied (see video below along with the PNG file I'm using).Environment
Device: moto g31(w) Android version: 11 Konfetti:
nl.dionsegijn:konfetti-compose:2.0.2
Code
Video of issue
https://user-images.githubusercontent.com/13498475/168575719-75eff0e2-d48d-44ef-a386-55f7ee898a92.mp4
PNG drawable