【问题标题】:KML ARGB color doesn't shown correctlyKML ARGB 颜色未正确显示
【发布时间】:2012-09-30 13:03:38
【问题描述】:

这是我正在处理的地图的屏幕截图:

这是我的 KML 代码:

<Style id="line1">
    <LineStyle>
        <color>ff8C0A23</color>
        <width>2</width>
    </LineStyle>
</Style>

<Placemark>
<styleUrl>#line1</styleUrl>
<LineString><coordinates> ...

您可以看到颜色值为ff8C0A23,它是ARGB,对吗?所以 RGB 颜色是8C0A23,应该是这样的:

但正如您所见,地图中显示的边框颜色完全不同。谁知道怎么解决?

【问题讨论】:

    标签: google-maps-api-3 colors kml


    【解决方案1】:

    https://developers.google.com/kml/documentation/kmlreference

    根据: https://developers.google.com/kml/documentation/kmlreference#color

    表达顺序为aabbggrr

    <color>
    Color and opacity (alpha) values are expressed in hexadecimal notation. The range of values for any one color 
    is 0 to 255 (00 to ff). For alpha, 00 is fully transparent and ff is fully opaque. The order of expression is 
    aabbggrr, where aa=alpha (00 to ff); bb=blue (00 to ff); gg=green (00 to ff); rr=red (00 to ff). For example, 
    if you want to apply a blue color with 50 percent opacity to an overlay, you would specify the following: 
    <color>7fff0000</color>, where alpha=0x7f, blue=0xff, green=0x00, and red=0x00.
    

    查看此颜色选择器: http://www.zonums.com/gmaps/kml_color/

    【讨论】:

    • 哦,所以这是 ABGR 不是 ARGB?谢谢,让我看看它是否工作...... :)
    • 我将其更改为ff230a8c,现在可以使用了!谢啦! :)
    猜你喜欢
    • 1970-01-01
    • 2015-11-23
    • 2011-08-06
    • 2012-12-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-29
    • 1970-01-01
    相关资源
    最近更新 更多