I'm currently working on an implementation of this, but would appreciate any feedback before I go too far down the rabbit hole :)
Example usage:
const red = new Swatch({
name: 'Primary/Red',
color: new Color('#c00')
});
sketch.addSwatch(red);
Then use the Swatch anywhere you'd normally use a Color:
artboard.addLayer(new Rectangle({
width: 100,
height: 100,
x: 10,
y: 10,
name: 'Red Box',
style: {
fills: [
{
color: red,
},
],
},
}));