Here's a simple script for ya if you want it. I didn't test this too much so let me know if there are any issues.
This will set the custom color for all selected items to the color of the track they are currently on. This will make it so items retain their colors as you drag them to different tracks.
Note, that currently, this script will wipe out any custom color an item may already have and replace it with the track's color. If you want it so that items will retain any custom color that may already be set let me know.