title: three-way color gradient fill in r
body: <p>How can I fill three way color gradient (heatmap) to a triplot (triangle plot), like this.</p>
  
  <pre><code>plot(NA,NA,xlim=c(0,1),ylim=c(0,sqrt(3)/2),asp=1,bty="n",axes=F,xlab="",ylab="")
  segments(0,0,0.5,sqrt(3)/2)
  segments(0.5,sqrt(3)/2,1,0)
  segments(1,0,0,0)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/kz0jN.jpg" alt="enter image description here"></p>
  
  <p>Color should run in parallel to triplot.</p>