4 Replies Latest reply: Jul 11, 2012 3:17 AM by AI_learner RSS

    How to find that art item has spot color?

    AI_learner Community Member

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

        • 1. Re: How to find that art item has spot color?
          A. Patterson Community Member

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

          • 2. Re: How to find that art item has spot color?
            AI_learner Community Member

            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.

            • 3. Re: How to find that art item has spot color?
              A. Patterson Community Member

              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;

              }

              • 4. Re: How to find that art item has spot color?
                AI_learner Community Member

                Thank you very much, Mr. Patterson...
                Its exactly the same what i need.