How to process a color ramp as an INPUT of a node group?

Hello, basically what the title says. The question is illustrated here:

You have to mixrgb inside colorramp with the value from the group input.
But that wont give you the result you expect i guess. Coloramp input gives the value not the position on the scale.
You want a global coloramp i guess?

VSHADE’s next version will has custom Linear Color Ramp nodes. Coming very soon.

Short answer: You can’t… at least not with a node group.

The reason why not, is that the output of a color ramp is the evaluated color for the ‘Fac’ value of that ColorRamp node, and not the color_ramp definition itself.

The solution is to use a Python CustomNodeGroup, where you can check if some input is connected to a ColorRamp node, and if it is, then you can reference the ‘color_ramp’ of that node in your internal nodetree.

Edit: Another possibility of a CustomNodeGroup is that you can add the ColorRamp interface to your custom node, turning the usage of an external ColorRamp node unnecessary…

Yes the palette defined by/in the ColorRamp node is not “parameterizable” (something like the green line) you have temporary output your data (pink line) and use an extern ColorRamp inputting the “ramped” color (disconnet internal) and output the result… of course in your example just put the ColorRamp after your Nodegroup because there is no further processing.

I want the Custom Node Group and the Color Ramp to be 2 separate entities. (for that reason I’m not trying to expose the Color ramp to the node group’s interface and I don’t want to use code for this).

What I’m trying to achieve is a collection of “basic building bricks” similar to Substance Designer’s way to build materials. And I want things to be very simple: just plug into a group that processes the information and immediately outputs the result.

I thought there could be some trick with a few nodes that will somehow allow me to transmit the information I need…

Thanks for the answers anyway.

Yes and the usual way to do so is having any custom node/group making any form/pattern/image and adding a (or mutliple) colorramp(s) afterward to get heightmaps and/or mask/coloring different areas for varying textures. So not “inputing” the colorramp into the custom node/group but just adding afterward.

I was looking for an answer for the same question.
It seams that we actually can control Color Ramp outside a node group.
Check this video:

As RGB or HSV value are normalized beetween zero and one, like vectors. You normally could use a map range node switched to vector to interpolate between two colors. And if you need more than two colors use another map range… and so on.

@RyanKingArt made a video some time ago that shows his process of adding color stops in a node group…

1 Like

Thanks for recommending my video! Hope it helps.

1 Like