Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How Can I Get the fill color of a page item?

New Here ,
Feb 23, 2010 Feb 23, 2010

Hello

     Using this way can get the fill color swatch name and UID, but how can I get the RGB value of this color ? 

   // Inspect fill colour.
  UID fillRenderingUID = kInvalidUID;
  if (Utils<IGraphicAttributeUtils>()->GetFillRenderingUID(fillRenderingUID, descriptor) == kSuccess) {
   PMString swatchName = Utils<ISwatchUtils>()->GetSwatchName (db, fillRenderingUID);
   SNIPLOG(" fillRenderingUID=0x%x swatchName=%s", fillRenderingUID, swatchName.GrabCString());
  }

 

  Is there a function I can get the RGB value by UID ? Or other way ?

TOPICS
SDK
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 24, 2010 Feb 24, 2010

Check SnpManipulateSwatch::IterateSwatchList

It should be explained there how to get Color data from swatch

Reagrds

Bartek

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 24, 2010 Feb 24, 2010

I have the same problem, but using C#.

When I try:

IndesignServer.Color color = (IndesignServer.Color)  TextFrame.FillColor;

A InvalidCastException occur, so not wanting to disturb but already disturbing, what is the correct cast to TextFrame.FillColor?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Feb 24, 2010 Feb 24, 2010
LATEST

Eliezer,

this is the forum for plugin development using the InDesign SDK and C++. C# uses the high level bindings like several other scripting languages, therefor you'll find to some degree better support next door in the scripting forum, you may also want to search the archives there.

I wrote "some degree" because the generally preferred language is cross platform JavaScript (ExtendScript), with minorities using the platform specific languages VBScript and AppleScript. The farther you move away from these languages to stronger typed languages e.g. newer brews of VisualBasic, or worse, C# - the more hassles you'll encounter because InDesign is mainly optimized to support the weak types. You'll also better have serious experience with your language of choice, e.g. how to use reflection features to determine class types and invoke methods that are otherwise inaccessible.

For InDesign Server specific questions there is the server forum. You better make yourself familiar with the basic concepts of InDesign Server - it is no system for workgroup publishing and multi-user workflow, but just an optimized faceless "service" component. Kindof a big code library to open and work on InDesign documents, just running in a separate process. For example it is used by many third party workflow systems for tasks that do not require user interference, instead controlled by their application server.

To get an idea of the required efforts to build such a workgroup system from scratch, we're talking of many man years even if your engineers already know most involved technologies and required concepts - nothing that you'll learn from occasional spoon-fed answers in a free forum.

Back on topic: for those rendering objects (colors), the color values are stored at IColorData. They will be most likely in CMYK color space, though.

Dirk

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines