This project has moved and is read-only. For the latest updates, please go here.

Issue with color conversion?

Jan 22, 2013 at 6:41 PM


I just started using SharpKml today - very pleased with the results so far.

I wonder if there is an issue with the color conversion for a style.  In my raw KML file I have a Polygon color set as "ffffaf00".  However, when I parse the same KML using SharpKml, the color is interpreted as "0ffffaf0" (note the 4 bit rotation).  Is this a known issue, or am I interpreting the output incorrectly?  The resulting Argb results in incorrect coloring on the PNG I generate from the KML.  (Note that the coloring when viewed in GE is fine, so I am confident the color string is correct in my original KML).

Many thanks, Kurt

Jan 30, 2013 at 9:39 PM
Hi Kurt, sorry about the delay getting back to you.

When you say the color is interpreted as 0ffffaf0, how are you seeing that value? The Abgr value returns an int to be CLS compliant, however, you can safely cast this to a uint and it should be the same value you are expecting. Alternatively you can access the individual color components via the Alpha/Blue/Green/Red properties.