For a gradient you need at least 2 colors.
The startcolor and the endcolor.
You can not compute the gradient from a single given pixel.