Sub GetParam
x = param["x"]
y = param["y"]
width = param["width"]
height = param["height"]
EndSub
Sub FillCurlyEllipse
' param x, y - left top corner
' param width, height - size
GetParam()
GraphicsWindow.BrushColor = "#111111"
GraphicsWindow.FillEllipse(x, y, width, height)
If debug Then
Goto fce_exit
EndIf
For i = 1 To (width * height) / (5 * 5)
rx = Math.GetRandomNumber(width / 2)
ry = Math.GetRandomNumber(height / 2)
a = Math.GetRandomNumber(360)
_a = Math.GetRadians(a)
cx = x + width / 2 + rx * Math.Cos(_a)
cy = y + height / 2 + ry * Math.Sin(_a)
DrawCurly()
EndFor
fce_exit:
EndSub
Sub FillCurlyRectangle
' param x, y - left top corner
' param width, height - size
GetParam()
GraphicsWindow.BrushColor = "#111111"
GraphicsWindow.FillRectangle(x, y, width, height)
If debug Then
Goto fcr_exit
EndIf
For i = 1 To (width * height) / (5 * 5)
cx = x + Math.GetRandomNumber(width)
cy = y + Math.GetRandomNumber(height)
DrawCurly()
EndFor
fcr_exit:
EndSub
Sub DrawCurly
r = 5
dr = 5 / (360 / 10)
a0 = Math.GetRandomNumber(360)
For a = 0 To 360 Step 10
_a = Math.GetRadians(a + a0)
cx = cx + r * a / 360 * Math.Cos(_a)
cy = cy + r * a / 360 * Math.Sin(_a)
_x = cx - r / 2
_y = cy - r / 2
l = (360 - a) / 3
GetColors()
GraphicsWindow.BrushColor = gray
GraphicsWindow.FillEllipse(_x, _y, 2*r, 2*r)
GraphicsWindow.BrushColor = black
GraphicsWindow.FillEllipse(_x + 1, _y + 1, 2*r, 2*r)
r = r - dr
EndFor
EndSub
Sub GetColors
α = (120 - l) * 255 / 120
dec = α
Math_Dec2Hex()
black = "#" + hex + "000000"
gray = "#" + hex + "222222"
EndSub
Sub Math_Dec2Hex
' Math | Convert decimal to hexadecimal
' param dec
' param hex
Stack.PushValue("math", dec)
hex = ""
While dec > 0
mod = Math.Remainder(dec, 16)
hex = Text.Append(Text.GetSubText("0123456789ABCDEF", mod + 1, 1), hex)
dec = Math.Floor(dec / 16)
EndWhile
If Text.GetLength(hex) = 0 Then
hex = "00"
ElseIf Text.GetLength(hex) = 1 Then
hex = Text.Append("0", hex)
EndIf
dec = Stack.PopValue("math")
EndSub