ratio = 5 ' vertical / horizontal
For y = 0 To gh*1.2 Step 6
For x = w250 To gw - 1 Step 4
GetColor()
GraphicsWindow.PenColor =medium
For z=0 to 4
GraphicsWindow.PenWidth=w[z*2+1]
GraphicsWindow.DrawLine (z*gw2+x-w250+ii, y/2+(4-z)*t30, z*gw2+x-3+ii-w250,y/2+25+(4-z)*t30)
'GraphicsWindow.PenWidth=w[z*2+2]
'GraphicsWindow.DrawLine (z*gw2+gw*2-x-w250, y, z*gw2+gw*2-x-3-w250,y+5)
endfor
EndFor
ii=ii+3
EndFor
Sub GetColor
' param x, y - point to get color
nx = x - xo
ny = (y - yo) / ratio
r = Math.Remainder(Math.SquareRoot(nx * nx + ny * ny), d)
If r < half Then
p = Math.Floor(r*h1)
MediumColor()
GraphicsWindow.PenColor = medium
Else
p = Math.Floor((d - r) *h1)
MediumColor()
GraphicsWindow.PenColor = medium
EndIf
EndSub
Sub MediumColor
' param dark, light - given colors
' param p - percentage
' return medium - medium color
For i = 1 To 3
hex = Text.GetSubText(dark, i * 2, 2)
'a = ESLMaths.HexToInteger (hex)
Math_Hex2Dec()
a = dec
hex = Text.GetSubText(light, i * 2, 2)
'b = ESLMaths.HexToInteger (hex)
Math_Hex2Dec()
b = dec
v[i] = Math.Floor(a * (1 - p / 100) + b * p / 100)
EndFor
medium = GraphicsWindow.GetColorFromRGB(v[1], v[2], v[3])
EndSub
Sub Math_Hex2Dec
' Math | Convert hexadecimal to decimal
' param hex - hexadecimal
' return dec - decimal
dec = 0
len = Text.GetLength(hex)
For ptr = 1 To len
dec = dec * 16 + Text.GetIndexOf("0123456789ABCDEF", Text.GetSubText(hex, ptr, 1)) - 1
EndFor
EndSub