This script is similar to the "Hi-Lo" or "Clear" methods of painting bars. Instead of using the tips/edges of the candles like those two, the "(H+L)/2" method uses the change in (high+low)/2 to paint the bars. This gives you some similar results if you were to be binary with the candle coloring. However, my coloring scheme is not entirely binary. There are 5 possible colors:
HL2>LastHigh = Bright Green
HL2<LastLow = Bright Red
HL2>LastHL2 = Dull Green
HL2<LastHL2 = Dull Red
Bar Change (close - open) is going against the indicator = Gray
Free to share and enjoy!
~B3