CircularGradient()

Syntax

CircularGradient(x, y, Radius)
Description
Sets the drawing gradient to have a circular shape around the x,y point with the given radius.

By default the gradient ranges from the current background color at x,y to the current front color at the distance given by Radius away from the x,y point. Additional colors can be added to the gradient with the GradientColor() command.

Note: This command only has an effect with ImageOutput(). The gradient only affects the drawing commands when #PB_2DDrawing_Gradient is set with the DrawingMode() command.

Example:

  If OpenWindow(0, 0, 0, 400, 200, "2DDrawing Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    If CreateImage(0, 400, 200) And StartDrawing(ImageOutput(0))
      Box(0, 0, 400, 200, $FFFFFF)
      
      DrawingMode(#PB_2DDrawing_Gradient)      
      BackColor($00FFFF)
      FrontColor($FF0000)
      
      CircularGradient(100, 100, 100)     
      Circle(100, 100, 100)
      CircularGradient(350, 100, 75)
      Circle(300, 100, 100)
      
      StopDrawing() 
      ImageGadget(0, 0, 0, 400, 200, ImageID(0))
    EndIf
    
    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
  EndIf

Supported OS

All

<- Circle() - 2DDrawing Index - ConicalGradient() ->