Give different colors for alternate row in gallery-Power Platform

How to give different colors for alternate row in a Gallery-Power Platform


Problem statement

Generally, we can give only one-color code (Template fill) to the rows in a gallery


Resolution

We can give the different color code to the alternate rows in a Gallery.

We can use the Collection instead of directly mapping a Data Source to the Gallery.


Use the following code in the Template Fill of a Gallery.