Lively Kernel canvas
//
DraftColorWheel40
Wikicontroltruetrue
$morph('container').submorphs.clone().invoke('remove')n=20drawColorRow=function(code,row){colors=eval(code)t=newTextMorph(newRectangle(0,(row*50),200,20),code)t.setFill(null)t.setBorderWidth(0)$morph('container').addMorph(t)for(vari=0;i<n;i++){m=Morph.makeRectangle(10+(i*50),20+(row*50),30,30);m.setFill(colors[i])$morph('container').addMorph(m)}}varj=0;drawColorRow('Color.wheelHsb(n,0,0.9,0.7)',j++)drawColorRow('Color.wheelHsb(n,0,0.7,0.7)',j++)drawColorRow('Color.wheelHsb(n,0,0.5,0.7)',j++)drawColorRow('Color.wheelHsb(n,0,0.3,0.7)',j++)drawColorRow('Color.wheelHsb(n,0,0.1,0.7)',j++)drawColorRow('Color.wheelHsb(n,0,0.9,1)',j++)drawColorRow('Color.wheelHsb(n,0,0.9,0.8)',j++)drawColorRow('Color.wheelHsb(n,0,0.9,0.6)',j++)drawColorRow('Color.wheelHsb(n,0,0.9,0.4)',j++)drawColorRow('Color.wheelHsb(n,0,0.9,0.2)',j++)drawColorRow('Color.wheelHsb(n,0,0.9,0.7)',j++)drawColorRow('Color.wheelHsb(n,30,0.9,0.7)',j++)drawColorRow('Color.wheelHsb(n,60,0.9,0.7)',j++)drawColorRow('Color.wheelHsb(n,90,0.9,0.7)',j++)drawColorRow('Color.wheelHsb(n,120,0.9,0.7)',j++)37
Color.wheelHsb(n,0,0.9,0.7)
Color.wheelHsb(n,0,0.7,0.7)
Color.wheelHsb(n,0,0.5,0.7)
Color.wheelHsb(n,0,0.3,0.7)
Color.wheelHsb(n,0,0.1,0.7)
Color.wheelHsb(n,0,0.9,1)
Color.wheelHsb(n,0,0.9,0.8)
Color.wheelHsb(n,0,0.9,0.6)
Color.wheelHsb(n,0,0.9,0.4)
Color.wheelHsb(n,0,0.9,0.2)
Color.wheelHsb(n,0,0.9,0.7)
Color.wheelHsb(n,30,0.9,0.7)
Color.wheelHsb(n,60,0.9,0.7)
Color.wheelHsb(n,90,0.9,0.7)
Color.wheelHsb(n,120,0.9,0.7)
Color.wheel2(n,0,0.9,0.7,360)
Color.wheel2(n,0,0.9,0.7,180)
Color.wheel2(n,0,0.9,0.7,90)
Color.wheel2(n,0,0.9,1,90)
Color.wheel2(n,0,0.9,1,180)
Color.wheel2(n,0,0.9,0.8,180)
Color.wheel2(n,0,0.9,0.6,180)
Color.wheel2(n,0,0.9,0.4,180)
Color.wheel2(n,0,0.9,0.2,180)
Color.wheel2(n,0,0.9,1,180)
Color.wheel2(n,0,0.7,1,180)
Color.wheel2(n,0,0.5,1,180)
Color.wheel2(n,0,0.3,1,180)
Color.wheel2(n,0,0.9,0.8,180)
Color.wheel2(n,0,0.7,0.8,180)
Color.wheel2(n,0,0.5,0.8,180)
Color.wheel2(n,0,0.3,0.8,180)
Color.wheel2(n,0,0.9,0.6,180)
Color.wheel2(n,0,0.7,0.6,180)
Color.wheel2(n,0,0.5,0.6,180)
Color.wheel2(n,0,0.3,0.6,180)
Color.wheel2(n,30,0.9,1,180)
Color.wheel2(n,60,0.9,1,180)
Color.wheel2(n,90,0.9,1,180)
Color.wheel2(n,120,0.9,1,180)
Color.wheel2(n,150,0.9,1,180)
Color.wheel2(n,180,0.9,1,180)
Color.wheel2(n,210,0.9,1,180)
Color.wheel2(n,240,0.9,1,180)
Color.wheel2(n,270,0.9,1,180)
Color.wheel2(n,300,0.9,1,180)
Color.wheel2(n,330,0.9,1,180)
Color.wheel2(n,360,0.9,1,180)
Color.wheel3(n,0,0)
Color.wheel3(n,0,0.3)
Color.wheel3(n,0,0.6)
Color.wheel3(n,0,0.9)
Color.wheel3(n,30,0.9)
Color.wheel3(n,60,0.9)
Color.wheel3(n,90,0.9)
Color.wheel3(n,120,0.9)
Color.wheel3(n,150,0.9)
Color.wheel3(n,180,0.9)
Color.wheel3(n,30,0.9,0.1)
Color.wheel3(n,60,0.9,0.2)
Color.wheel3(n,90,0.9,0.3)
Color.wheel3(n,120,0.9,0.4)
Color.wheel3(n,150,0.9,0.5)
Color.wheel3(n,180,0.9,0.6)
Color.wheel4(n,0,0,0.0)
Color.wheel4(n,0,0,0.1)
Color.wheel4(n,0,0,0.2)
Color.wheel4(n,0,0,0.3)
Color.wheel4(n,0,0,0.4)
Color.wheel4(n,0,0,0.5)
$morph('container2').submorphs.clone().invoke('remove')n=20drawColorRow=function(code,row){colors=eval(code)t=newTextMorph(newRectangle(0,(row*50),200,20),code)t.setFill(null)t.setBorderWidth(0)$morph('container2').addMorph(t)for(vari=0;i<n;i++){m=Morph.makeRectangle(10+(i*50),20+(row*50),30,30);m.setFill(colors[i])$morph('container2').addMorph(m)}}Color.wheel2=function(n,hue,sat,brt,angleSpan){vara=newArray(n);angleSpan=angleSpan||360;varstep=angleSpan/(Math.max(n,1));for(vari=0;i<n;i++)a[i]=Color.hsb(hue+i*step,sat,brt);returna;}varj=0;drawColorRow('Color.wheel2(n,0,0.9,0.7,360)',j++)drawColorRow('Color.wheel2(n,0,0.9,0.7,180)',j++)drawColorRow('Color.wheel2(n,0,0.9,0.7,90)',j++)drawColorRow('Color.wheel2(n,0,0.9,1,90)',j++)drawColorRow('Color.wheel2(n,0,0.9,1,180)',j++)drawColorRow('Color.wheel2(n,0,0.9,0.8,180)',j++)drawColorRow('Color.wheel2(n,0,0.9,0.6,180)',j++)drawColorRow('Color.wheel2(n,0,0.9,0.4,180)',j++)drawColorRow('Color.wheel2(n,0,0.9,0.2,180)',j++)drawColorRow('Color.wheel2(n,0,0.9,1,180)',j++)drawColorRow('Color.wheel2(n,0,0.7,1,180)',j++)drawColorRow('Color.wheel2(n,0,0.5,1,180)',j++)drawColorRow('Color.wheel2(n,0,0.3,1,180)',j++)drawColorRow('Color.wheel2(n,0,0.9,0.8,180)',j++)drawColorRow('Color.wheel2(n,0,0.7,0.8,180)',j++)drawColorRow('Color.wheel2(n,0,0.5,0.8,180)',j++)drawColorRow('Color.wheel2(n,0,0.3,0.8,180)',j++)drawColorRow('Color.wheel2(n,0,0.9,0.6,180)',j++)drawColorRow('Color.wheel2(n,0,0.7,0.6,180)',j++)drawColorRow('Color.wheel2(n,0,0.5,0.6,180)',j++)drawColorRow('Color.wheel2(n,0,0.3,0.6,180)',j++)drawColorRow('Color.wheel2(n,30,0.9,1,180)',j++)drawColorRow('Color.wheel2(n,60,0.9,1,180)',j++)drawColorRow('Color.wheel2(n,90,0.9,1,180)',j++)drawColorRow('Color.wheel2(n,120,0.9,1,180)',j++)drawColorRow('Color.wheel2(n,150,0.9,1,180)',j++)drawColorRow('Color.wheel2(n,180,0.9,1,180)',j++)drawColorRow('Color.wheel2(n,210,0.9,1,180)',j++)drawColorRow('Color.wheel2(n,240,0.9,1,180)',j++)drawColorRow('Color.wheel2(n,270,0.9,1,180)',j++)drawColorRow('Color.wheel2(n,300,0.9,1,180)',j++)drawColorRow('Color.wheel2(n,330,0.9,1,180)',j++)drawColorRow('Color.wheel2(n,360,0.9,1,180)',j++)Color.wheel3=function(n,hue,sat,offset){vara=newArray(n);offset=offset||0;varstep=(1-offset)/(Math.max(n,1));for(vari=0;i<n;i++){a[i]=Color.hsb(hue,sat,i*step+offset);}returna;}drawColorRow('Color.wheel3(n,0,0)',j++)drawColorRow('Color.wheel3(n,0,0.3)',j++)drawColorRow('Color.wheel3(n,0,0.6)',j++)drawColorRow('Color.wheel3(n,0,0.9)',j++)drawColorRow('Color.wheel3(n,30,0.9)',j++)drawColorRow('Color.wheel3(n,60,0.9)',j++)drawColorRow('Color.wheel3(n,90,0.9)',j++)drawColorRow('Color.wheel3(n,120,0.9)',j++)drawColorRow('Color.wheel3(n,150,0.9)',j++)drawColorRow('Color.wheel3(n,180,0.9)',j++)drawColorRow('Color.wheel3(n,30,0.9,0.1)',j++)drawColorRow('Color.wheel3(n,60,0.9,0.2)',j++)drawColorRow('Color.wheel3(n,90,0.9,0.3)',j++)drawColorRow('Color.wheel3(n,120,0.9,0.4)',j++)drawColorRow('Color.wheel3(n,150,0.9,0.5)',j++)drawColorRow('Color.wheel3(n,180,0.9,0.6)',j++)Color.wheel4=function(n,hue,sat,offset){vara=newArray(n);varstep=(1-offset)/(Math.max(n,1));for(vari=0;i<n;i++){a[i]=Color.hsb(hue,sat,i*step+offset);}returna;}drawColorRow('Color.wheel4(n,0,0,0.0)',j++)drawColorRow('Color.wheel4(n,0,0,0.1)',j++)drawColorRow('Color.wheel4(n,0,0,0.2)',j++)drawColorRow('Color.wheel4(n,0,0,0.3)',j++)drawColorRow('Color.wheel4(n,0,0,0.4)',j++)drawColorRow('Color.wheel4(n,0,0,0.5)',j++)115
null68