Here's one way. This assumes that the long axis of your glow stick is the Z axis.
The Texture Coordinate node will give you a value for each dimension that varies between 0 and 1, in the form of a color map.
The separateXYZ node will give you just the Z value.
The ColorRamp converts that value into a single color.
My color ramp goes from black to white, but you can change the color
- Select the color ramp
- click in the vicinity of one of the two pointers
- click on the color patch just about the Fac input
- Select a color from the color picker
There are many ways to adjust the color ramp. You can move the pointers around. THe most useful to you might be that moving the right pointer farther left will reduce the area where the fade happens.
