When I tag a file with a color in Pantheon Files, where is the tag recorded?
I guessed it may be stored in a hidden file in the same directory (similar to what Windows and macOS do), but I did not find such file.
The file-color associations are stored in the
~/.config/marlin/marlin.db sqlite database.
This should answer your question as well: How can I change label color for any entry in Files, using scripts?