particlepy.math
- fade_alpha(particle: particlepy.particle.Particle, alpha: int, progress: float) float [source]
Fades
alpha
(transparency) of argumentparticle
over life span (progress
) to new color (color
)- Parameters
particle (
particlepy.particle.Particle
) – Particle to alpha color withalpha (int) – Transparency to fade to
progress (float) – Life span identifier:
particlepy.particle.Particle.progress
orparticlepy.particle.Particle.inverted_progress
- Returns
New alpha of particle
- Return type
float
- fade_color(particle: particlepy.particle.Particle, color: Tuple[int, int, int], progress: float) list [source]
Fades color of
particle
over life span (progress
) to new color (color
)- Parameters
particle (
particlepy.particle.Particle
) – Particle to fade color withcolor (Tuple[int, int, int]) – Color to fade to
progress (float) – Life span identifier:
particlepy.particle.Particle.progress
orparticlepy.particle.Particle.inverted_progress
- Returns
New color of particle
- Return type
List[float]
- Raises
AssertionError – If
particle.shape
notparticlepy.shape.BaseForm