A Swatch represents a named color, tint, gradient or pattern contained within an Illustrator document.
They can be retrieved from the document through document.swatches.
Creates a new Swatch object.
Sample code:
// create the swatch var swatch = new Swatch(); swatch.color = new RGBColor(1, 0, 0); swatch.name = 'Red'; // add it to the document's swatch list document.swatches.push(swatch);
The name of the swatch.
The color of the swatch.
The document that the object belongs to. Read-only.
Removes the swatch from the document's swatch list.