diagram based foreground color
better flip node
fixed some layout glitches