Write a LUT to file in FreeSurfer format.
Details
The declared columns type, hemi and context are written after the
colours, so that read_lut() reads them back. FreeSurfer reads only the
first six fields of a line and skips comments, so the file stays a valid
colour table for it.
A table with type alone gets it as a 7th field, left off rows that have
none. A table with hemi or context gets a comment line naming the
fields, and every row then carries each one, written as NA where it
declares nothing. Other columns are not written.
See also
read_lut(), is_lut(), lut_classify_anatomy() to fill in
the type column