Skip to content
Snippets Groups Projects
Commit ee4f37b9 authored by Egli Adrian (IT-SCI-API-PFI)'s avatar Egli Adrian (IT-SCI-API-PFI)
Browse files

rendering: color fix

parent 432260b7
No related branches found
No related tags found
No related merge requests found
......@@ -781,8 +781,9 @@ class RenderTool(object):
position = agent.position
direction = agent.direction
old_direction = agent.direction
self.gl.setAgentAt(iAgent, *position, old_direction, direction)
cmap = self.gl.get_cmap('hsv', lut=max(len(self.env.agents), len(self.env.agents_static) + 1))
self.gl.setAgentAt(iAgent, *position, old_direction, direction,color=cmap(iAgent))
if show:
self.gl.show()
......
......@@ -60,7 +60,7 @@ class SVG(object):
sNewStyles = "\n"
for sKey, sValue in self.dStyles.items():
if sKey == style_name:
sValue = "fill:#" + "".join([format(col, "#04x")[2:] for col in color]) + ";"
sValue = "fill:#" + "".join([ ('{:#04x}'.format(int(255.0*col))[2:4]) for col in color[0:3]]) + ";"
sNewStyle = "\t.st" + sKey + "{" + sValue + "}\n"
sNewStyles += sNewStyle
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment