Any tips to get a better mix of all colours, or even a more balanced traditional set of rainbow colours?
Code: Select all
#width=1800
#height=900
OpenWindow(0,0,0,#width,#height,"Window")
CreateImage(0,#width,#height)
ImageGadget(0,0,0,#width,#height,ImageID(0))
StartDrawing(ImageOutput(0))
Global.i r,g,b
Box(0,0,#width,#height,#Black)
For x=0 To #width-1
r=128+Round((128-0.5)*Sin((2*#PI)/#width*x+(2*#PI)/360*0),#PB_Round_Down)
g=128+Round((128-0.5)*Sin((2*#PI)/#width*x+(2*#PI)/360*120),#PB_Round_Down)
b=128+Round((128-0.5)*Sin((2*#PI)/#width*x+(2*#PI)/360*240),#PB_Round_Down)
Line(x,0,1,#height-700,RGB(r,g,b))
Circle(x,500-r,10,#Red)
Circle(x,500-g,10,#Green)
Circle(x,500-b,10,#Blue)
Next
StopDrawing()
SetGadgetState(0,ImageID(0))
Repeat
Repeat
Event = WindowEvent()
Select Event
Case #PB_Event_Gadget
If EventGadget() = 0
End
EndIf
Case #PB_Event_CloseWindow
End
EndSelect
Until Event = 0
Until Event = #PB_Event_CloseWindow

