# How do I remap colors in Cycles?

I'd like to remap colours in Cycles the way one would have done in Blender Internal, such that I could take the output of the shader/material and change the range of colours to something else, say from a ramp. This was how Blender Guru was able to change the texture map on his Realistic Earth so that the dark side of the planet had one texture, while the other did not. Such a technique could also be used to affect the fac input on Mix Nodes, as well as parameters, such as Glossy 'Roughness'.

I've tried many things without achieving the results I desire, but I'm still new to Cycles.

• for the earth night map, i used a BW night texture with emission, can only be seen where the planet is not illuminated by the sun. Works if the planet moves or rotates. but if static, you can use a vertex color map/texture as a factor – Bithur Feb 14 '15 at 18:39
• I'm not sure what you mean, as you can use a Color Ramp's output as a factor for anything, out of the box. Could you clarify as to what is not working, exactly? – someonewithpc Feb 14 '15 at 18:46
• for a planet rotating, the ground texture has to follow but the "night" is on the dark side, relative to light's direction. A color ramp can map the dark side but doesn't know where the light comes from, and will follow the rotation/movement of the planet. – Bithur Feb 14 '15 at 18:54
• this is not a problem if the planet/sun is not animated. just put a color ramp on your UV coordinates and use it as factor for day/night textures (or vertex color map) – Bithur Feb 14 '15 at 18:58
• What do you want to do? – Bithur Feb 14 '15 at 19:00

## It looks like what you are looking for its the color ramp node.

The color ramp node can take any value between 0 and 1 (values outside this range will be clamped to 0 or 1) in it's fac input socket. And it will output the respective color from the gradient specified by the color swatches just like in BI.

• Use the + and - buttons to add more swatches.
• Use the <-> button to flip the order of swatches.
• The color (and alpha value) of the selected swatch is set with the large color strip at the bottom of the node.
• You can adjust the exact position of the selected swatch with the pos spinner.
• The alpha gradient is outputted through the alpha output socket.

So it could, as you mentioned, be used to adjust the affect of an image texture on a mix shader (the image texture could just get plugged directly into the mix shader if no color adjustment is needed though).

• damn, you're right, i just misunderstood... :) – Bithur Feb 14 '15 at 19:22
• I just tried this node setup that you posted, however it does not perform as expected 9ie: changing the blend factor according to luminance of the object/geometry itself). What am I missing? How does the image texture work as a factor? Also, what I need is interactive with the shader/material output, rather than an image texture. – H Petrus Feb 15 '15 at 1:01