private IEnumerator ColorGradient(Color targetColor, float gradientDuration) { while (spriteRenderer.color != targetColor) { spriteRenderer.color = Annex.toColor(Vector3.SmoothDamp(Annex.toVector3(spriteRenderer.color), Annex.toVector3(targetColor), ref colorSmoothing, gradientDuration)); yield return(null); } }