(defn weight-colour ([^double weight] (Color. (clamp-colour-value (Math/tanh (- weight))) (clamp-colour-value (Math/tanh weight)) 0.0)))
So when weight is 0, it's black. As the weight gets more positive, the colour gets greener, and as the weight gets more negative, the colour gets redder. clamp-colour-value makes sure the colour component doesn't go outside the interval (0,1)
tanh curve shown here: http://upload.wikimedia.org/wikipedia/commons/7/76/Sinh_cosh...
http://upload.wikimedia.org/wikipedia/commons/7/76/Sinh_cosh...