How to send a color into a ColorRamp from outside a group?

I have an iris shader that uses a ColorRamp node, and the middle color (there are three colors in the ColorRamp – black, blue, and black) is the color of the iris:

I would like to be able to wrap up my iris shader into a group and feed in a color from outside the group to the middle color of the ColorRamp node so that, instead of blue, it could be brown or green or whatever. However, the ColorRamp does not let me feed a color into it.

I have tried several alternate ways of being able to feed a color into the group, but no solution I’ve attempted has given satisfactory results so far. Any ideas?

Not possible with the color ramp as such. But I’ve seen custom node groups that allows you to set stop position and color, but with a limited amount of stops and the ease mode you’d probably have to setup yourself.

1 Like

With a simple ramp setup like you have you could set the ramp’s ‘iris colour’ to white and multiply a fed in colour with the output of the ramp.

Only if the position of the stops are fixed.

Do you mean like this?

Because this is something I tried and, as you can tell by the picture, it has a very washed-out color for the iris; not the same shade of blue that I’m feeding in (or the same shade of blue that was originally in the color ramp).

Ah – never mind! You mean the other kind of multiply, as in multiplying images, not the “Math” multiply:

Yes, this works well and is good enough for my purposes. Thanks for the idea!

(I’m fine with the position of the stops being fixed. I can always go into the group and tweak things more if needed, but I want to start with a good default and be able to swap out the color quickly as needed.)

Math multiply only deals with a single channel. MixRGB multiply deals with three.

1 Like

The inputs and outputs of nodes have different colors. Gray is a single channel value for example a gray scale image, yellow is a triple channel value like a color. Blue is also a triple channel value but generally used for vector related things.

Try to use combined node group like this https://bis.interplanety.org/library/materials/item/769