Client Tag Color Bindings

I'm not sure if this is relevant at all..
But if it helps, this is what I use for 'pipes' (line shapes). Maybe this could be made into a template itself, but I find using templates with components that need to be aligned perfectly sometimes doesn't work so well, which is why I've steered clear with them for pipes. That being said, if the template and components within the template are an integer size, and everything is placed at integer positions on the canvas, it should be ok. I know the pipe component itself is super dodgy when it comes to alignment in the client. I never use those!

def getPipeColour(flow, contents):
	colour = ""
	colourName = contents + ' - ' + {0:'No Flow',1:'Flow'}[flow]
	colour = pipeColourCache.get(colourName, colourCache['Invalid State'])
	return colour

RE a {source.name} reference, see Phil's post, but heed Paul's warning:

That being said though, I have tested using runScript within an expression binding on about 350 objects on the page, all updating at a 500ms rate (flashing colours), and there was no noticeable delay/lag/slowness at the client whatsoever

1 Like