;;;; SUMMARY ;; A minor variation of the standard NetLogo color chart ;; COPYRIGHT ;;;; ;;;; ;;;; ;;;; patches-own [ x y ] ;; alternate coordinate system ;; (not the same as pxcor and pycor) to startup setup end to setup ca ;; make the background white and set up an alternate ;; coordinate system ask patches [ set pcolor white set x pxcor + max-pxcor - 5 set y max-pycor - pycor - 1 ] ;; draw all the colors 0 to 139 ask patches with [(x >= 0) and (x <= 9) and (y >= 0) and (y <= 13)] [ set pcolor y * 10 + x set plabel int pcolor ] ask patches with [ x = 10 and y >= 0 and y <= 13 ] [ sprout 1 [ set color 0 set shape "square" set heading 0 set size 4.5 ] ] ;; draw the rightmost column of whites ask patches with [(x = 12) and (y >= 0) and (y <= 13)] [ set plabel (word precision (y * 10 + 9.9) 4 " " )] ;; draw the color key on the left ask patches with [(x = -2) and (y >= 0)] [ if y = int (blue / 10) [ set plabel "blue" ] if y = int (brown / 10) [ set plabel "brown" ] if y = int (cyan / 10) [ set plabel "cyan" ] if y = int (gray / 10) [ set plabel "gray" ] if y = int (green / 10) [ set plabel "green" ] if y = int (lime / 10) [ set plabel "lime" ] if y = int (magenta / 10) [ set plabel "magenta" ] if y = int (orange / 10) [ set plabel "orange" ] if y = int (pink / 10) [ set plabel "pink" ] if y = int (red / 10) [ set plabel "red" ] if y = int (sky / 10) [ set plabel "sky" ] if y = int (turquoise / 10) [ set plabel "turquoise" ] if y = int (violet / 10) [ set plabel "violet" ] if y = int (yellow / 10) [ set plabel "yellow" ] set plabel (word plabel " = " (y * 10 + 5) " " ) ] ;; add black and white in the top row ask patches with [y = -1] [ if x = 0 [ set plabel "black = 0" ] if x = 12 [ set plabel "white = 9.9 " ] ] ;; all make the patch labels visible against background ask patches [ ifelse pcolor mod 10 >= 4 [ set plabel-color black ] [ set plabel-color white ] ] end @#$#@#$#@ GRAPHICS-WINDOW 76 10 713 536 9 7 33.0 1 18 1 1 1 0 1 1 1 -9 9 -7 7 0 0 1 ticks CC-WINDOW 5 550 722 645 Command Center 0 BUTTON 12 10 67 43 reset setup NIL 1 T OBSERVER NIL NIL NIL NIL @#$#@#$#@ == WHAT IS IT? == This model is a variation of the Models Library model that was used to generate the color chart in the NetLogo User Manual. This version uses turtles to create black boxes around the white colors. == XML TAGS == A color chart Copyright 2004,2009 James P. Steiner @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 link true 0 Line -7500403 true 150 0 150 300 link direction true 0 Line -7500403 true 150 150 30 225 Line -7500403 true 150 150 270 225 square false 0 Rectangle -7500403 false true 121 120 298 180 @#$#@#$#@ NetLogo 4.0.4 @#$#@#$#@ setup @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@