How to get the current bar color? Is there any function() for this task?

 

How to get the current bar color? Is there any function() for this task?

 I have an idea to know the current bar color. Comparing if the open price is greater than closing price/current price then it means that current bar is red. Do you think my idea is correct?

 
Yes
Reason: