title: Change a single bar color based on MA direction/color
body: <p>I'm new to Pine Script and learning to write some simple codes. I've made a HMA script that changes color based on direction. Here's the code:</p>
  <pre><code>study(title=HMA, overlay=true)    
  src = input(close, title=Source)    
  len = input(20, title=HMA Length)    
  hma1 = hma(src, len)    
  hmacolor = change(hma1)&gt;=0 ? color.green : color.red    
  plot(hma1, color=hmacolor, title=HMA)    
  barcolor(change(hma1)&gt;=0 ? color.green : color.red) 
  </code></pre>
  <p>I'm able to change the series of bar color using the current barcolor code. But what I'd like instead, is to be able to change just a single bar's color(as a signal) when the direction/color of HMA changes.</p>
  <p>Any help will be greatly appreciated.</p>
  <p>Thanks</p>