# How do I autogenerate gradient lighting?

I am trying to think of a way to generate a gradient like this picture:

Something like this GetGradientTexture(360f,100(width),100(height)), or if i want a directional light (like a flashlight) 180f,10,200.

But I can't really think of a good way to do this. Does anyone have anything that can push me in the right direction?

To do that circular type of gradient you can just take the length from the "Point" by doing. this code gives you a straight gradient.

vec1 = [ 1, 1, 1 ]; // this is your start point.
vec2 = [ 2, 2, 2 ]; // this is your endpoint.
vec3 = vec1 - vec2;