InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnpManipulateSwatch Class Reference

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)
 

Detailed Description

  • Create the gradient swatch,
  • Create the RGB color swatch,
  • Create the CMYK color swatch,
  • Delete a swatch,
  • Create color swatch by external name and setting,
  • Iterate swatch list,
  • Iterate ink list.

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.

See Also
IWorkspace
ISwatchUtils
ISwatchList
IRenderingObject
IGraphicStateUtils

Constructor & Destructor Documentation

SnpManipulateSwatch::SnpManipulateSwatch ()

Constructor.

virtual SnpManipulateSwatch::~SnpManipulateSwatch ()
inlinevirtual

Destructor.

Member Function Documentation

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.

Returns
color swatch UID.
UID SnpManipulateSwatch::CreateGradientSwatch (IWorkspacewarkspace)

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.

Parameters
warkspaceThe workspace that swatch is made.
Returns
gradient swatch UID.
ErrorCode SnpManipulateSwatch::DeleteSwatch (UIDRef ref2Delete)

Delete the specified swatch.

Parameters
ref2DeleteSpecifies UIDRef of swatch to be deleted.
Returns
kSuccess on success, other ErrorCode otherwise.
UID SnpManipulateSwatch::GetCMYKColourUIDByName (IWorkspacewarkspace,
const PMStringcolorName,
const PMRealc,
const PMRealm,
const PMRealy,
const PMRealk 
)

swatch is looked up with a name from the swatch list. If it is not here, swatch of the CMYK color is made.

Parameters
warkspaceThe workspace that swatch is made.
colorNameColor swatch name.
cA cyan rate.
mA magenta rate.
yA yellow rate
kA black rate
Returns
color swatch UID.
UID SnpManipulateSwatch::GetRGBColourUIDByName (IWorkspacewarkspace,
const PMStringcolorName,
const PMRealr,
const PMRealg,
const PMRealb 
)

swatch is looked up with a name from the swatch list. If it is not here, swatch of the RGB color is made.

Parameters
warkspaceThe workspace that swatch is made.
colorNameColor swatch name.
rA red rate.
gA green rate.
bA blue rate
Returns
color swatch UID.
void SnpManipulateSwatch::IterateInkList (IWorkspaceworkspace)

This method iterates ink list of active workspace, show the ink information on the snip log.

void SnpManipulateSwatch::IterateSwatchList (IWorkspaceworkspace)

This method iterates active swatch list, show the swatch information on the snip log.