Is there a way to separate colors from chained mix rgb nodes? I am creating a node group that I would like to be able to make 6- 8 individual colors available for the material. While it would be ideal, I am aware that color ramps cannot be used from outside of a node group. As an alternative, I have tried chaining mixRGB nodes with the intent of separating the colors individualy. The problem I am having is that chaining mix rgb nodes seems to be unpredictable at times as to how exactly colors will mix/ separate. 

The following image is to better illustrate my difficulty. The material settings in node shown are for the object displayed. The resulting mix is nothing like what is selected from the group. It seems that colors are ignored rather than combined or separated, and I don't know how to control this. I ultimately want to control a color per node in the 'math' node group within the material, which I think I can work out once I get this part sorted. 



I have seen and tried working with this answer, but wasn't able to work with it when combining multiples of these groups together. I am also having a similar problem with the proposed answer. (Separating colors predictably) 

Thus far, I have the material somewhat working but the colors blend somewhat unpredictably and seem to be a bit unreliable in how the material is affected. I haven't been able to find a good way to approach the problem. Below are the current node setups for the approaches I have been using.

This is my current node setup for my approach using mix rgb nodes:



What I would like to achieve, I have come close to using color ramps, but the problem there is that in order to make a change to color, I have to open the group, make the changes, and then continue. 

This is the setup I used with color ramps: 


This is the 'Math" node group within the material:



The general look I am after is as follows, the shader ball on the left is assigned the mix rgb setup, and the one on the right,which would be closer to the look I'd like the material to have is the color ramp setup:



Is what I am trying to do possible? If so, what is the correct way of doing this? 

Here is the .blend file for anyone who would like to take a closer look and not copy a node setup from a screen shot:
Here is a way that can help :



I dont consider here the way you are using this kind of ramp, but I have just focused on a way to obtain the ramp. So I did not wanted here to reproduce the way you are using the shader (only the ramp).

This "pseudoRamp" node group is a thread of several "rampMix" nodes groups (this node group can be reused to have more or less colors as inputs) :



And the role of each of them is to give a color between two (the previous color and the tested color) depending if the value is in between the values margins.

Here is the "rampMix" :



And the "rampMix" itself uses a "between" node group :



This last "between" node group needs to handle the limits of "lesser than", as it is strict ("&lt;" and not "&lt;="). So we cannot use "lesser than" with a "greater than" or we will miss the limit value.

Here is the blend file 

Note : this is not perfect at the limit, as you cannot downgrade the amount of colors (the last will stay last, but previous ones can overlap each other). So a little enhancement is needed for that.

Complement for the criss crossed aspect

The nodes described above can be mixed in order to make crossed color lines :

The first nodes on the left are here to modulate the amount of strips and are based only on the X, Y values in order to cross these axis only.