[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LOGO-L> Color Palette



Hi Turtlers,

If you ever wished to see at once all 16 colors your Logo can provide; if you ever wished to see how they come out on your color printer, here's a program for you.

It will run, with very minute modification (if any) on any flavor of Logo. The attached palette is for MSWLogo, with its 16 single-index colors.

You might notice, that the grid is drawn by inner recursion, while the coloring job is done by tail recursion.

Enjoy,

[[Yehuda]]



to colorpal
cs ht
pu setxy -140 -140 pd draw 280 3
pu seth 90 legend data 0
pd setpc 0
end

to draw :size :level
if :level<1[stop]
repeat 4[shape]
end

to shape
fd :size rt 90
draw :size/2 :level-1
end

to legend :data :col
if emptyp :data[stop]
setfc :col setpc floodcolor+7
setpos first :data fill label :col
legend bf :data :col+1
end

to data
op[[-108 112][-38 112][32 112][101 112]
   [-108  44][-38  44][32  44][101  44]
   [-108 -26][-38 -26][26 -26][ 96 -26]
   [-114 -94][-44 -94][26 -94][ 96 -94]]
end
 

GIF image



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home