Swatches and the legend

Export Swatches writes two files.

File

What it is

MaterialID.aco

A Photoshop swatch file. Every swatch is named after its material.

MaterialID.csv

material,hex,r,g,b — one row per material

Load the .aco in Photoshop with Swatches panel ▸ panel menu ▸ Import Swatches. You then click a named swatch instead of sampling a pixel.

The .aco is written with both a version 1 and a named version 2 block, so older Photoshop versions read it too. Affinity Photo can import .aco palettes; for other software the .csv is the practical route.