particlepy.math

fade_alpha(particle: particlepy.particle.Particle, alpha: int, progress: float) float[source]

Fades alpha (transparency) of argument particle over life span (progress) to new color (color)

Parameters
  • particle (particlepy.particle.Particle) – Particle to alpha color with

  • alpha (int) – Transparency to fade to

  • progress (float) – Life span identifier: particlepy.particle.Particle.progress or particlepy.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 with

  • color (Tuple[int, int, int]) – Color to fade to

  • progress (float) – Life span identifier: particlepy.particle.Particle.progress or particlepy.particle.Particle.inverted_progress

Returns

New color of particle

Return type

List[float]

Raises

AssertionError – If particle.shape not particlepy.shape.BaseForm