sync on sync rate 0 cls xcenter=screen width()/2 ycenter=screen height()/2 power#=12500 dim gridbrightness#(screen width()/10,screen height()/10) do cls inc r#,7 inc r2#,1+(mousemovex()^2+mousemovey()^2)/17.0^2 inc r3#,4.26 n=cos(r#)*90 xcenter=mousex() ycenter=mousey() totalbrightness#=0 for sx=0 to screen width() step 10 for sy=0 to screen height() step 10 rem translate coordinates x1#=(sx-xcenter)*0.05 y1#=(sy-ycenter)*0.05 rem rotate coordinates x#=cos(r2#)*x1#+sin(r2#)*y1# y#=sin(r2#)*x1#-cos(r2#)*y1# rem calculate brightness brightness#=power#/(abs(x#^2-y#^2+n)+1.0) brightness#=brightness#/255.0 if brightness#>1 brightness#=1 endif rem calculate color inc totalbrightness#,brightness# if brightness#>=gridbrightness#(sx/10,sy/10) gridbrightness#(sx/10,sy/10)=brightness# else brightness#=gridbrightness#(sx/10,sy/10) endif color=hsl(r2#/360.0,1,0.5) color=rgb(rgbr(color)*brightness#,rgbg(color)*brightness#,rgbb(color)*brightness#) ink color,0 rem render tile box sx,sy,sx+9,sy+9 gridbrightness#(sx/10,sy/10)=gridbrightness#(sx/10,sy/10)*0.87 next sy next sx rem mouseclick if mouseclick()=0 m#=m#/1.2 else inc m#,60 endif m#=m#/1.03 if m#<0 then m#=0 rem balance the brightness power#=power#+(800+m#+300.0*cos(r3#)-totalbrightness#)*0.9 sync loop function hsl(H#,S#,L#) local r local g local b while h#>1 dec h#,1 endwhile while h#<0 inc h#,1 endwhile if ( S# = 0 ) `HSL values = 0 ÷ 1 rR# = L# * 255 `RGB results = 0 ÷ 255 rG# = L# * 255 rB# = L# * 255 else if ( L# < 0.5 ) var_2# = L# * ( 1 + S# ) else var_2# = ( L# + S# ) - ( S# * L# ) endif var_1# = (2 * L#) - var_2# R = 255.0 * Hue_2_RGB( var_1#, var_2#, H# + ( 1.0 / 3.0 ) ) G = 255.0 * Hue_2_RGB( var_1#, var_2#, H# ) B = 255.0 * Hue_2_RGB( var_1#, var_2#, H# - ( 1.0 / 3.0 ) ) endif color=rgb(r,g,b) endfunction color Function Hue_2_RGB( v1#, v2#, vH# ) if ( vH# < 0 ) then vH# = vH# + 1 if ( vH# > 1 ) then vH# = vH# - 1 if ( ( 6 * vH# ) < 1 ) then res#=( v1# + ( v2# - v1# ) * 6.0 * vH# ): exitfunction ( res# ) if ( ( 2 * vH# ) < 1 ) then exitfunction ( v2# ) if ( ( 3 * vH# ) < 2 ) then res#=( v1# + ( v2# - v1# ) * ( ( 2.0 / 3.0 ) - vH# ) * 6.0 ):exitfunction ( res# ) Endfunction v1#