Color wheel: Difference between revisions
→{{header|Ring}}
Line 909:
<lang ring>
#===================================================================#
#
#
#===================================================================#
load "guilib.ring"
▲xWidth = 300
▲yHeight = 300
{
{ setwindowtitle("ColorWheel-FastDraw")
▲ setGeometry(500,150,xWidth,yHeight)
{ ### daVinci paints the MonaLisa on the Canvas
color = new qcolor(){ setrgb(255,255,255,0) }
#endpaint() ### This will Stop the Painting. For Animation comment it out
}
setPixMap(MonaLisa)▼
show()▼
exec()▼
}
ColorWheel()
}
//=====================
pi = 3.14159265359
diameter = pi * 2
radius = yHeight / 2
v = 1 // value/brightness 1 to 100 1=bright 0=dark
iradius = i - radius
p = pow( iradius, 2)
for j = 1 to yHeight
▲ #=====================================================================#
▲ ? "Start Processing..."
▲ t1 = clock()
▲ ? "Clock : " + t1
▲ #=====================================================================#
h = (atan2( iradius, j-radius ) + pi ) / diameter // hue/color 1 to 360
▲ aList = []
▲ for i = 1 to xWidth
▲ s = sqrt(p+pow(j-radius,2))/radius
▲ if s < = 1 and h < = 1
▲ aList + [i,j,h,s,1,1]
▲ next
▲ next
return
//==================
</lang>
|