How to use rowBGColorCalc

This is an example, where you have normal rowbg coloring and the empty fields are colored red.

function bg_method()
{
	var _rowindex = arguments[0]
	var _isSelected = arguments[1]
	var _field_type = arguments[2]
	var _field_name = arguments[3]
	var _form_name = arguments[4]
	var _state = arguments[5]
		

	if(_state[_field_name] == null)
	{
		return "#FF0000"
	}
	                       
	if(_isSelected)
	{
	   return "#FFFFCC"
	}
	else
	{
	   if(_rowindex  % 2 == 0)
	   {
	      return "#DCDCDC"
	   }
	   else
	   {
	      return "#F2F2F2"
	   }
	} 
			
}