mapbox.com上的示例返回了有关悬停特性的良好信息,以及填充颜色https://docs.mapbox.com/mapbox-gl-js/example/queryrenderedfeatures/
返回的填充颜色如下所示:
"feature": {
"type": "Feature",
"layer": {
"id": "data",
"type": "fill",
"source": "jsx-source-1",
"paint": {
"fill-color": {
"r": 0.6398494117647059,
"g": 0.26332078431372546,
"b": 0.1670227450980392,
"a": 0.7
}
},
"layout": {}
},
"source": "jsx-source-1",
"state": {}
},
标签";r"g"b"a";似乎是rbga颜色代码,但返回的值不是。这是什么?
知道如何将其转换为rgba、hex、hsl吗?
我想明白了。将单个值乘以255以获得rgb代码;a";(阿尔法(。