fb:porticula NoPaste
96teiliger Farbkreis
Uploader: | Marc Bonus |
Datum/Zeit: | 10.09.2017 18:18:43 |
' Farbkreis-96.bas ' 96 teiliger Farbkreis
#Include "fbgfx.bi"
IF SCREENRES(1280,1024,32,,FB.GFX_NO_FRAME or FB.GFX_ALWAYS_ON_TOP or FB.GFX_ALPHA_PRIMITIVES) THEN
PRINT "Fehler: Grafikfenster konnte nicht initialisiert werden!"
SLEEP
END
END If
Type SFarbkreis
Name As String '(14)
r As Integer
g As Integer
b As Integer
End Type
' Farbarray erstellen
Dim Farbkreis(11) As SFarbkreis
Farbkreis(0).Name = " Rot"
Farbkreis(0).r = 227
Farbkreis(0).g = 35
Farbkreis(0).b = 34
Farbkreis(1).Name = " Rotorange"
Farbkreis(1).r = 237
Farbkreis(1).g = 89
Farbkreis(1).b = 30
Farbkreis(2).Name = " Orange"
Farbkreis(2).r = 241
Farbkreis(2).g = 142
Farbkreis(2).b = 28
Farbkreis(3).Name = "Gelborange"
Farbkreis(3).r = 249
Farbkreis(3).g = 194
Farbkreis(3).b = 12
Farbkreis(4).Name = " Gelb"
Farbkreis(4).r = 244
Farbkreis(4).g = 229
Farbkreis(4).b = 0
Farbkreis(5).Name = " Gelbgrün"
Farbkreis(5).r = 145
Farbkreis(5).g = 221
Farbkreis(5).b = 46
Farbkreis(6).Name = " Grün"
Farbkreis(6).r = 0
Farbkreis(6).g = 188
Farbkreis(6).b = 37
Farbkreis(7).Name = " Blaugrün"
Farbkreis(7).r = 26
Farbkreis(7).g = 168
Farbkreis(7).b = 114
Farbkreis(8).Name = " Blau"
Farbkreis(8).r = 42
Farbkreis(8).g = 113
Farbkreis(8).b = 176
Farbkreis(9).Name = "Blauviolett"
Farbkreis(9).r = 88
Farbkreis(9).g = 106
Farbkreis(9).b = 196
Farbkreis(10).Name = " Violett"
Farbkreis(10).r = 146
Farbkreis(10).g = 80
Farbkreis(10).b = 191
Farbkreis(11).Name = "Rotviolett"
Farbkreis(11).r = 219
Farbkreis(11).g = 4
Farbkreis(11).b = 147
Dim Shared As Double Grad,Winkel,Nak,D
DIm Shared As Integer CenterX,CenterY,AC,x1,y1,x2,y2,x3,y3,z, x, t
Declare Function GSin (Winkel AS Single) AS Single
Declare Function GCos (Winkel AS Single) AS Single
Declare Function Diagram (AC AS Integer) AS Integer
'
D = 2*3.14159265/360
Function GSin (Wink AS Single) AS Single
Return -Sin((wink+90)* D)
End Function
Function GCos (Wink AS Single) AS Single
Return -Cos((wink+90)* D)
End Function
Color RGB(0, 0, 0), RGB(255, 255, 255)
Cls
CenterX = 1280/2 ' (%WinRight - %WinLeft)/2
CenterY = 1024/2 '(%WinBottom - %WinTop - 60)/2
Circle(CenterX,CenterY),500
z=0:grad=0+AC ' Felder
While z < 6
x1=CenterX+GSin(Grad)*500
y1=CenterY+GCos(Grad)*500
x2=CenterX+GSin(Grad+180)*500
y2=CenterY+GCos(Grad+180)*500
Line (x1,y1) - (x2,y2)
Grad=Grad+30
' If Grad>360:Grad=Grad-360
'EndIf :
z=z+1
Wend
z=0:grad=15 ' Farben
While z < 12
x1=CenterX+GSin(Grad)* 400
y1=CenterY+GCos(Grad)* 400
WITH Farbkreis(z)
PAINT (x1, y1), RGB(.r,.g,.b), RGB(0,0,0)
END With
Grad=Grad+30
z = z + 1
Wend
Circle(CenterX,CenterY),440
Circle(CenterX,CenterY),380
Circle(CenterX,CenterY),320
Circle(CenterX,CenterY),260
Circle(CenterX,CenterY),200
Circle(CenterX,CenterY),140
Circle(CenterX,CenterY),80
z=0:grad=15 ' helle Töne
For z = 0 To 3
For t = 0 To 11
x1=CenterX+GSin(Grad+(t*30))* (40 + (z * 60))
y1=CenterY+GCos(Grad+(t*30))* (40 + (z * 60))
x2=CenterX+GSin(Grad+180)*500
y2=CenterY+GCos(Grad+180)*500
Paint(x1, y1), RGBA(255,255,255,255-((z+1)*54)), RGB(0,0,0)
Next
Next
z=0:grad=15 ' dunkle Töne
For z = 5 To 8
For t = 0 To 11
x1=CenterX+GSin(Grad+(t*30))* (40 + (z * 60))
y1=CenterY+GCos(Grad+(t*30))* (40 + (z * 60))
x2=CenterX+GSin(Grad+180)*500
y2=CenterY+GCos(Grad+180)*500
Paint(x1, y1), RGBA(0,0,0,(z+1)*54), RGB(0,0,0)
Next
Next
Sleep
End