Best way to implement changing of color globally on a blocks theme?

HI there ,
I am looking for some help with finding a nice and easy way to change the color of all elements in a blocks theme. If i take the flex theme from the pinegrow tailwind tutorial on YouTube as an example that has bg-green-500 as primary color and i want to make an option to be able to change that to say bg-blue-500 , bg-indego-500 etc etc.

Is there a way to add the colors in a variable and add that variable to the different elements and make an option with a dropdown to select the color variables so it switches the color from a theme setting or something?

It would be nice to have it as a global setting and not a block setting so you have to change block by block,