这是一项简单的任务 我想将颜色例如:“rgb(255255,0)”传递到html文件,以便可以更改文本颜色
我在html文件中使用了这个片段
``{% for i in range(0,len) %}
new mapboxgl.Marker({
color: {{ colors[i]|safe }}
}).setLngLat([
{{ lang[i] }},
{{ lat[i] }}])
.addTo(map);
{%endfor%}
我通过以下方式传递颜色列表:
colors=[]
maxValue = max(totalConfimedList)
for item in totalConfimedList:
print(item)
# colors.append(code_map(int(item),0,int(maxValue),0,255))
if int(item) >255:
colors.append("\'rgb(255,0,0)")
continue
colors.append("\"rgb("+item+"0,0)\"")
在CHROME的HTML中,它的名称是color: "rgb(200,0)"
这种颜色不会出现。请帮帮我
jinja 2模板:-
相关问题 更多 >
编程相关推荐