How to make CMS powered background gradients

Hey all, so I recently had a request from client where all colors on their services pages needed to change depending on the colors selected in the CMS item for each service. Anyhow, took a little while to think this through, but did the below that overrides the default footer gradient on those specific CMS pages (but you can use the code to set the gradient of any element on the collection list template page).

I did a quick blog post of how to do that in case anyone needs this. You can find it here as well as the little bit of code you need to add to an HTML embed.