I'm trying to make a radial gradient to use as a texture for my game character shadow. I want to be able to pass a number to a function to make the gradient using the number of given colours. For example CreateGradient (5) would make a gradient with 5 steps, CreateGradient (100) would make a gradient with 100 etc
Only needs to be black and white. And the gradient needs to always fill the whole 256 x 256 texture with 2d drawing commands only. Something like this:

Could somebody please help me out?
Thanks
Only needs to be black and white. And the gradient needs to always fill the whole 256 x 256 texture with 2d drawing commands only. Something like this:

Could somebody please help me out?
Thanks