Discussion:
Color profile in CDM files?
(too old to reply)
JohnD
2010-03-10 22:05:13 UTC
Permalink
Hi, I am writing an XSLT to output each Entity from a Conceptual Model
diagram but would like to export the correct color. Looking at the
CDM file I see colors described like

<a:LineColor>4227200</a:LineColor>
<a:FillColor>1422826</a:FillColor>
<a:ShadowColor>12632256</
a:ShadowColor>

What format is this? Is there a way to parse into RGB or Hex?

TIA,
John
rkkier
2010-03-17 15:51:47 UTC
Permalink
The number you're seeing is blue + (green * 256) + (red * 65536). Now
you just need to find a high school math student to tell you how to
convert it back. My kid is 4 and apparently they haven't gotten that
advanced in daycare yet.
rkkier
2010-03-17 17:36:51 UTC
Permalink
allright, couldn't resist:

r = trunc(color#/65536)
g= trunc(color#-(r*65536)/256)
b= trunc(color#-(color#/65536)-trunc(color#-(r*65536)/256))

there's probably an easier way, but this works. I couldn't find
vbscript function that was the opposite of the rgb() function.
JohnD
2010-04-08 13:39:24 UTC
Permalink
Thanks; that's a strange way to store colors and a complicated formula
that I would have never figured out.

Loading...