Radial Gradient?

Blitz3D Forums/Blitz3D Programming/Radial Gradient?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Doesn't have to be bezier curves neccessarily IMHO. Simply say something like:

Graphics 640,480,32,2
SetBuffer BackBuffer()


;usage: blob x,y,w,h,levels of grey

blob 0,0,256,256,16



While KeyDown(1)=0
 Color 255,255,255
 Rect 0,0,100,20,1
 Color 0,0,0
 Text 0,0,Hex$(ReadPixel(MouseX(),MouseY() And $ffffff))
 Flip
Wend
WaitKey()




Function blob(x,y,w,h,shades)
 Color 255,255,255
 Rect x,y,w,h,1

 x_factor#=w/256.0
 y_factor#=h/256.0

 mystep#=256.0/(shades)
 mystep2#=256.0/(shades-1)
 bri=0
 ra_0=0

 While bri<256
  ra=255-ra_0
  If ra<0 Then ra=0
  If ra>255 Then ra=255

  bri2=255-bri
  If bri2<0 Then bri2=0
  If bri2>255 Then bri2=255
  Color bri2,bri2,bri2
  Oval x+(((w/2))-(ra/2)*x_factor),   y+(((h/2))-(ra/2)*y_factor),  ra*x_factor, ra*y_factor,1
  bri=bri+mystep2
  ra_0=ra_0+ mystep
 Wend
End Function



Oops - Ross was faster.