How do you set alternating colors in the list of topics

What would be the best way to implement this with different colors depending on whether the light or dark theme is in use?