Code: Select all
t = 0
inc = 0.5
NUM_LINES = 40
GRAPHICS
GRAPHICS CLEAR 0, 0, 0
GET SCREEN SIZE SW, SH
matiz1 = 0
w2 = sw / 2
h2 = sh / 2
DRAW SIZE 1
DO
IF matiz1 > 360 THEN matiz1 = matiz1 - 360
matiz2 = matiz1 + 60
IF matiz2 > 360 THEN matiz2 = matiz2 - 360
matiz3 = matiz1 + 120
IF matiz3 > 360 THEN matiz3 = matiz3 - 360
matiz4 = matiz1 + 180
IF matiz4 > 360 THEN matiz4 = matiz4 - 360
FOR i = 0 TO NUM_LINES STEP 1
a1 = x1(t + i)
b1 = y1(t + i)
a2 = x2(t + i)
b2 = y2(t + i)
pal(matiz1/360)
DRAW COLOR pal.r, pal.g, pal.b
DRAW LINE w2+a1, h2+b1 TO w2+a2, h2+b2
pal(matiz2/360)
DRAW COLOR pal.r, pal.g, pal.b
DRAW LINE w2+y1(t + i), h2+x1(t + i) TO w2+y2(t + i), h2+x2(t + i)
pal(matiz3/360)
DRAW COLOR pal.r, pal.g, pal.b
DRAW LINE w2+y2(t + i), h2+y1(t + i) TO w2+x1(t + i), h2+x2(t + i)
pal(matiz4/360)
DRAW COLOR pal.r, pal.g, pal.b
DRAW LINE w2+x2(t + i), h2+x1(t + i) TO w2+y1(t + i), h2+y2(t + i)
FILL COLOR 0, 0, 0
DRAW RECT -width / 2, -height / 2 TO 2 * width, 2 * height
IF cnt > 10000 THEN
GRAPHICS SAVE 0, 0, sw, sh TO "saver.jpg"
ALBUM EXPORT "saver.jpg"
END
END IF
cnt += 1
NEXT i
t += 0.5
matiz1 += inc
UNTIL 0
DEF x1(x)
RETURN SIN(x / 10) * 350
END DEF
DEF y1(y)
RETURN COS(y / 15) * 120
END DEF
DEF x2(x)
RETURN SIN(x / 15) * 350 + COS(x / 20) * 50
END DEF
DEF y2(y)
RETURN COS(y / 10) * 120 + SIN(y / 20) * 200
END DEF
' add RGB to HSB conversion
'r' ===== Saturated Palette function by Henko ======
DEF pal(t)
t*=360 ! t%=360
r=0 ! g=0 ! b=0
IF t<120 OR t>240 THEN r=palsub(ABS(t-360*FLOOR(t/240)))
IF t<240 THEN g=palsub(ABS(t-120))
IF t>120 THEN b=palsub(ABS(t-240))
END DEF
DEF palsub(e)
f=.5 ' 0<=f<=1 better balance between prim. and sec. colors
IF e<60 THEN c=1 ELSE ! x=(120-e)/60 ! c=x*(1+f-f*x) ! END IF
RETURN c
END DEF