How to create a color gradient on a building facade using Grasshopper?

I am currently working on a architectural project and trying to create a color gradient effect on a building facade using Grasshopper.

Specifically, I want to achieved a gradient transition [例如:from bottom to top / based on panel sizes / based on an attractor point].

I am a bit stuck on the best approach to map the colors to the facade panels properly. Should I use the Gradient component combined with Custom Preview, or is there a better way to prepare this for rendering/baking?

What I want to achieve:

  • A smooth color transition across the facade panels.

I have attached my current script definition and a screenshot of my reference below. Any guidance, component suggestions, or example files would be greatly appreciated!

Thanks in advance for your help!

05192026 博嘉國小 外牆漸層.gh (62.7 KB)

05192026 外牆漸層顏色.3dm (791.2 KB)