Skip to content

JavaScript Color Manipulation Examples

Add a color to the document

await publisher.executeFunction("document.colors", "Add");
editorObject.ExecuteFunction("document.colors", "Add");

Set a color property

Example properties: c, m, y, k, or r, g, b.

const colorName = "myColor";
await publisher.setProperty(`document.colors[${colorName}]`, "k", 75);
const colorName = "myColor";
editorObject.SetProperty(`document.colors[${colorName}]`, "k", 75);