increasing number of possible gradient colors

hey there,

i am trying to find a way to increase the possible amount of gradient colors. at the moment only a number of 32 is possible.

Any ideas on this?

I assume you mean the maximum amount of stops for a color ramp?

It’s a hardcoded limit, you would need to increase the value for the RNA property in the source code and compile your custom Blender.

If your question is about color ramps, and if you don’t want to make changes to the blender source code, you could try to use more than one color ramp. (just an idea)

For example, you could use two color ramps. In this case you could use the first one for factor values between 0 and <0.5 - and a second one for values between 0.5 and 1. This way you would end up with 64 stops.

I guess, it depends on want you are planning to do - but in theory nothing can stop you from adding 2, 10 or even 100 color ramps :slight_smile:

If you don’t mind me asking: What do you need more than 32 gradient colors for?

hey there, i thought about that too. so far I use processing to generate the gradient. I use it as a texture for planes so that i have quite thin stripes in custom colors.

Do you have an example image? I’m not sure if I picture this correctly. Maybe there is another way to achieve that effect?

for example the following is made with noise in blender. but i like to be able to position colors at a certain place in a horizontal grid. so that the space between the colors is fixed.


It depends on what exactly you are planning to do. (I guess the colors need to be set dynamically, so you can’t simply paint a texture.)
But I still think this could be done by using several gradients. Something like this:


Maybe OSL would be an option worth checking out. But I have no idea how that works :slight_smile: