Assigning a Filament (aka Thermal Preset) to an Extruder

Color discussion here: Macro snippet to calculate the Euclidean distance between filament colors

In short, I’m trying to work out some math that will optimize purge volumes on material changes based on the colors of the filaments being switched.