Reference a centrally stored list

I have a rather long list that converts temperature to color so I can plot nice graphs.
This code is duplicated for each graph, not ideal.

Is there a way to save the list in a file and just include it in my lovelace cards?
I use lovelace in UI mode, I don’t want the extra work of defining stuff in pure yaml.