The way to read it is that everything in the bracket on a line is banned with the number in the comment at the end of the line. So '{ 2 4 13 14 } #14' means that 2, 4, 13, and 14 (from the bracket) are banned with 14 (comment label). Colors are not *automatically* banned with themselves. That's why each line has the comment number in the bracket, to do that ban.
For 3 colors, it still just uses these ban lists. Suppose the game picks 4 for the 1st color (out of 0 thru 14). Now it can pick 0, 1, 3, 5, 8, 11, or 12 for the next color (everything that isn't banned with 4). Now suppose it picks 0 for the 2nd color. Now it can only pick 3, 5, 8, 11, or 12 (everything that isn't banned with 4 *or* 0) for the last color.