Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use colors with an alpha value #59

Open
cplachta opened this issue Jun 5, 2018 · 5 comments
Open

Use colors with an alpha value #59

cplachta opened this issue Jun 5, 2018 · 5 comments

Comments

@cplachta
Copy link

cplachta commented Jun 5, 2018

I can't seem to use any colors with transparency, how would I go about doing this?

Thanks!

@DanielMartinus
Copy link
Owner

DanielMartinus commented Jun 6, 2018

Hmm, interesting. Technically you can use color integers for Konfetti but the system is currently manipulating the alpha level in Particle.kt here.

I assume you have different colors of which some have different alpha values. This is an interesting use case that I didn't think of when making this.

I can either:

  • Apply a fix so that the alpha value is not set when you turn this off with a setting when creating the particle system
  • The alpha value is manipulated based on the alpha value of the color

The latter works for most use cases but requires some work. Let me know if you have any ideas

@cplachta
Copy link
Author

cplachta commented Jun 6, 2018

I was thinking maybe you could leave the alpha value of the color and instead of changing the alpha on each particle, could you manipulate the alpha value of the KonfettiView for the fadeOut?

@DanielMartinus
Copy link
Owner

Unfortunately the fade out has to happen for each particle individually since they each have a different lifespan and moment to disappear.

@cplachta
Copy link
Author

cplachta commented Jun 7, 2018

Ah okay. Then yeah, the second option would probably work (using the alpha value of the color).

@Millais
Copy link

Millais commented Apr 6, 2024

This does not solve the original issue... but in case it helps someone else, I used an alpha modifier on the KonfettiView itself in Compose to get all particles to appear with less intensity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants