![]() | InDesign SDK 20.5 |
Classes | |
| struct | SnpGradientStep |
Public Member Functions | |
| SnpManipulateSwatch () | |
| virtual | ~SnpManipulateSwatch () |
| UID | CreateGradientSwatch (IWorkspace *warkspace) |
| ErrorCode | DeleteSwatch (UIDRef ref2Delete) |
| UID | GetRGBColourUIDByName (IWorkspace *warkspace, const PMString &colorName, const PMReal &r, const PMReal &g, const PMReal &b) |
| UID | GetCMYKColourUIDByName (IWorkspace *warkspace, const PMString &colorName, const PMReal &c, const PMReal &m, const PMReal &y, const PMReal &k) |
| void | SetGradientType (const GradientType &p) |
| void | SetSwatchName (const PMString &s) |
| UID | CreateColorSwatch () |
| void | IterateSwatchList (IWorkspace *workspace) |
| void | IterateInkList (IWorkspace *workspace) |
This snippet creates a new gradient swatch based on swatches called "Step 1" and "Step 2" and "Step 3" (created as needed). When you run the snippet, specify the name of your new swatch, and choose the type of gradient. The new swatch will be created, and will appear in the Swatches panel. If a swatch by the name you specify already exists, a new one will not be created. The snippet also demonstrates how to create a color swatch that matchs a defined setting of external swatch and iterate swatch list and ink list as well.
| SnpManipulateSwatch::SnpManipulateSwatch | ( | ) |
Constructor.
| inlinevirtual |
Destructor.
| UID SnpManipulateSwatch::CreateColorSwatch | ( | ) |
This method creates a new color swatch with the same definition of PANTONE 368 C If a swatch is successfully created, the UID of the swatch will be returned.
| UID SnpManipulateSwatch::CreateGradientSwatch | ( | IWorkspace * | warkspace | ) |
This method creates a gradient swatch and returns its UID. If a swatch by the given name already exists, the UID of the existing swatch will be returned.
| warkspace | The workspace that swatch is made. |
| ErrorCode SnpManipulateSwatch::DeleteSwatch | ( | UIDRef | ref2Delete | ) |
Delete the specified swatch.
| ref2Delete | Specifies UIDRef of swatch to be deleted. |
| UID SnpManipulateSwatch::GetCMYKColourUIDByName | ( | IWorkspace * | warkspace, |
| const PMString & | colorName, | ||
| const PMReal & | c, | ||
| const PMReal & | m, | ||
| const PMReal & | y, | ||
| const PMReal & | k | ||
| ) |
swatch is looked up with a name from the swatch list. If it is not here, swatch of the CMYK color is made.
| warkspace | The workspace that swatch is made. |
| colorName | Color swatch name. |
| c | A cyan rate. |
| m | A magenta rate. |
| y | A yellow rate |
| k | A black rate |
| UID SnpManipulateSwatch::GetRGBColourUIDByName | ( | IWorkspace * | warkspace, |
| const PMString & | colorName, | ||
| const PMReal & | r, | ||
| const PMReal & | g, | ||
| const PMReal & | b | ||
| ) |
swatch is looked up with a name from the swatch list. If it is not here, swatch of the RGB color is made.
| warkspace | The workspace that swatch is made. |
| colorName | Color swatch name. |
| r | A red rate. |
| g | A green rate. |
| b | A blue rate |
| void SnpManipulateSwatch::IterateInkList | ( | IWorkspace * | workspace | ) |
This method iterates ink list of active workspace, show the ink information on the snip log.
| void SnpManipulateSwatch::IterateSwatchList | ( | IWorkspace * | workspace | ) |
This method iterates active swatch list, show the swatch information on the snip log.