In case, if anybody is interested to know the solution to the problem, here it is: Problem with passing color to histograms