float ye = Mathf.PingPong(Time.time,duration)/duration;
obj*.renderer.material.color = Color.Lerp(startColor, endColor, ye);*
How to color arrives endColor stopped?
These are Google translation.
Not exactly sure if i understand your question right, but seeing the PingPong, are you trying to lerp from the start color to the end and then reverse back to the start, and you instead want to stop it at the end?
Just don’t use PingPong then, like
if (ye < 1) {
renderer.material.color = Color.Lerp(colA, colB, ye);
ye += Time.deltaTime / duration;
}
hope that helps.