I didn't fully understand your explanation of which colors you want where, but really all you have to do is set CData as you like it - there's one row for each bar and the columns a red, green, and blue (ranging from 0 to 1):
x = (1:20)';
y = rand(20,1);
h=bar(x,y);
h.FaceColor='flat';
ind = 1:20;
redind = ind < 16 & ind >=5;
greenind = ind >= 16;
blueind = ind < 5 | ind == 8;
h.CData(redind, :) = repmat([1 0 0],sum(redind),1);
h.CData(greenind, :) = repmat([0 1 0],sum(greenind),1);
h.CData(blueind, :) = repmat([0 0 1],sum(blueind),1);