Skip to main content
Inspiring
July 19, 2016
Question

Getting the ID and the RGB array for the tag color of a XML tag

  • July 19, 2016
  • 3 replies
  • 2996 views

I need to get the array of double values eg: (124,255,255) for the tag color applied on XML tag.

Note that I need values for RGB color space only.

var color = oXMLTag.tagColor;

The above returned color is enumeration is most of the cases (RED,CYAN etc).

How can I get the double values for this color also the color ID.

This topic has been closed for replies.

3 replies

13H
Inspiring
February 4, 2017

I measured each of the colours and hardcoded them in. See the getUIcolorValue function.

Community Expert
February 4, 2017

:-)
Ok. I should have rephrased my question:


How did you measure the UI Colors ?

I see two ways:

1. Using the colors with guides and export to PDF including guides.

2. Using the colors with conditional text and export to PDF.

Measuring can be done with Acrobat Pro or a rendered pixel image from the PDF with PhotoShop.

Depending on our color management settings we could get RGB values in e.g. sRGB.

Regards,
Uwe

13H
Inspiring
February 5, 2017

I measured RGB values with Digital Colour Meter using Display native values. See screenshot attached. What are you worried about?

13H
Inspiring
February 1, 2017

var color = getUIcolorValue(oXMLTag.tagColor);

function getUIcolorValue(r){if(r.constructor===Array)return pColour;switch(String(r)){case"BLACK":return[0,0,0];case"BLUE":return[0,0,255];case"BRICK_RED":return[153,0,0];case"BROWN":return[153,51,0];case"BURGUNDY":return[153,0,51];case"CHARCOAL":return[171,163,181];case"CUTE_TEAL":return[130,207,194];case"CYAN":return[0,255,255];case"DARK_BLUE":return[0,0,135];case"DARK_GREEN":return[0,84,0];case"FIESTA":return[247,89,107];case"GOLD":return[255,153,0];case"GRASS_GREEN":return[153,204,0];case"GRAY":return[128,128,128];case"GREEN":return[79,255,79];case"GRID_BLUE":return[122,186,217];case"GRID_GREEN":return[156,222,156];case"GRID_ORANGE":return[255,181,107];case"LAVENDER":return[153,153,255];case"LIGHT_BLUE":return[79,153,255];case"LIGHT_GRAY":return[186,186,186];case"LIGHT_OLIVE":return[140,166,107];case"LIPSTICK":return[207,130,181];case"MAGENTA":return[255,79,25];case"OCHRE":return[153,102,0];case"OLIVE_GREEN":return[102,102,0];case"ORANGE":return[255,102,0];case"PEACH":return[255,153,153];case"PINK":return[255,153,204];case"PURPLE":return[102,0,102];case"RED":return[255,0,0];case"SULPHUR":return[207,207,130];case"TAN":return[204,153,102];case"TEAL":return[0,153,153];case"VIOLET":return[153,51,255];case"WHITE":return[255,255,255];case"YELLOW":return[255,255,79];default:return alert("Could not find UI colour called "+String(pColor)),[186,186,186]}}

Community Expert
February 1, 2017

Hi CoverBuilder,

how did you gather the RGB values for the UIColors ?

Thanks,
Uwe

Vamitul
Legend
July 19, 2016