Hi all,
I have a number of art items on a document, some of them are filled with spot colors and some of them are with process color.
Is there any api or method by which I can find out which color type(spot or process) is applied to the selected art item?
Thanx in advance...
Its definitely doable, but its a pain in the butt depending on how thorough you want to be.
The trick is to get down to a set of AIColor structs for your art object. Once you have that, its fairly easy to tell if its a spot colour or not. The trick is, unfortunately, getting said list of AIColor structs.
Before I explain, are you concerned with art that has multiple strokes or fills? Are you looking to make this fully robust for any art object? (Symbols are going to be particularly annoying, just an FYI).
Thanx for the reply,
No, Currently I am concerned with simple arts cases only (other cases might came later).
For now Let's say i have two rectangular box one is filled only with spot color and other only using process color. When I select any one of them I want to know which color type is used to fill that art objects
Thanx.
I believe this should do the trick:
bool HasFillSpotColor(AIArtHandle handle)
{
bool result = false;
AIPathStyle pathStyle;
AIErr error = sPathStyle->GetPathStyle(handle, &pathStyle);
// check error
if (pathStyle.fillPaint) {
AIColor color = pathStyle.fill.color;
if (color.kind == kCustomColor) {
AICustomColor customColor;
error = sCustomColor->GetCustomColor(color.c.c.color, &customColor);
// check error
result = customColor.flag & kCustomSpotColor;
}
}
return result;
}
North America
Europe, Middle East and Africa
Asia Pacific