Hey there!
I'm kinda new to SD (and to this cool forum!) and I'm trying to create color variation for a simple tile texture.
the logic is that I want the user to pick how many color he want to have, and add weight sliders per every color.
here is an example for hard coded one with some histogram select:





The issue here is that the color are overlapping, if yellow color will have high range and green small they might overlap and not show any green one...and its not generic, if I want to add another color I need to add a lot of nodes.
So I tried new a approach figuring out with numbers inputs and functions:
Deciding there are 3 number (user input - 8,1,1) based on that u get the range for every color. (the user input is not the percent its how much every number effect the "total value" and then it calculate the percent...in other word its weight.)


now I'm stack with how to use that float3 in histogram select and making sure there are no overlapping (something with the position maybe?).
also I have couple of questions

:
1) Is there a way to make it dynamic? like if the user decide to have 3 color and then switch to 5 can I create a for loop or something? or deciding on max value and creating the edge case is the best way?
2) I cant use more then 4 colors with this way cause it limited by the float variable...is there a better way for that?
3)I'm still not familiar with all the nodes in SD so I'm checking...is there a node that do that? :P
Would love to here your opinion about how you solve this and if this even useful/necessary to have this feature.