I think we need to examine your request a bit closer.
stays above/below the previous day cross over
A crossover is an event. A crossover does not have any value accept true or false. It is therefore not possible for price to "above a crossover event". So you need to explain the missing component. Exactly what determines this value that the price needs to remain above or below in order to set the color to purple or yellow? HINT: At the point of the crossover event, that bar contains 5 data points:
- Open
- High
- Low
- Close
- Moving average
Once we understand which of these data points you intend to use we can attempt to solve this. This implies that at the crossover event there is a fixed value that is set and held for subsequent bars until the next crossover event occurs. The code would then use this fixed data point as the comparison for "remains above" or "remains below".
Depending on your response, the request may turn out to me more complex than I can solve in the limited amount of time I allow for free solutions in the Q&A Forum.