Skip navigation
Currently Being Moderated

How to find that art item has spot color?

Jul 4, 2012 7:01 AM

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...

 
Replies
  • Currently Being Moderated
    Jul 4, 2012 7:24 AM   in reply to AI_learner

    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).

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 5, 2012 7:39 AM   in reply to AI_learner

    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;

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points