0

I'm generating KML files from a script, and am attempting to apply color styles. Can't find any documentation of some color styles requiring ARGB (alpha-channel, red, green, blue) format and others ABGR (alpha, blue, green, red) format, but that's what Google Earth is doing.

For example, I have a style "green0"

<Style id="green0">
    <LineStyle>
        <color>ff55aa00</color>
        <width>5</width>
    </LineStyle>
    <PolyStyle>
        <color>b355aa00</color>
    </PolyStyle>
</Style>

this is a dark green, written in the text file as ARGB and interpreted by Google Earth as ARGB.

I have another style "red0"

<Style id="red0">
    <LineStyle>
        <color>ffff0000</color>
        <width>5</width>
    </LineStyle>
    <PolyStyle>
        <color>b3ff0000</color>
    </PolyStyle>
</Style>

This is pure red, written in ARGB. However, Google Earth interprets this as ABGR, and colors it as pure blue.

When loading into Google Earth, fixing the colors and saving, "green0" values are the same, saved as ARGB. However "red0" values are updated to below:

<Style id="red0">
    <LineStyle>
        <color>ff0000ff</color>
        <width>5</width>
    </LineStyle>
    <PolyStyle>
        <color>b30000ff</color>
    </PolyStyle>
</Style>

Google Earth is saving these as ABGR.

I have other styles, and they feed up to style maps. Full KML is here: https://github.com/mikeyj777/data_for_support_qs/blob/main/python_to_kml/kml_from_byte_str_sol.kml

There are multiple styles. The styles associated with green and pink are the first in the list, and are interpreted as ARGB. the others in the list below those are interpreted as ABGR.

what would cause it to interpret some values in ARGB and others in ABGR?

1 Answer 1

0

Per documentation, format should be ABGR. I'm assuming that in some cases, Google Earth is smart enough to look at the names and infer what's going on.

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Mar 18, 2023 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.