You can also use ColorMix() Function by giving color ranges. It will select colors inbetween your given ranges.
Or do 1 thing. Go to Colors Tab, Define different Colors for each Box you have the option to give 18 different colors and then check Persistent colors.
After every 18 colors, the bars again start with the same colors 1-18 than again after 36 Bars same color pattern repition.
Hope that helps.
You could also make a table and load it with the fields SEGMENT, segR,segG,segB, these should be the respective rgb values you want to assign to each segment. Then in the expression tab of the properties expand the options for that expression by clicking the + sign and in the background color put the expresssion rgb(segR,segG,segB)