Libraries‎ > ‎Library‎ > ‎Appearance‎ > ‎

Patch color

BehaviourComposer: ignore everything before this.
Begin micro-behaviour:
Begin description:
Change the color of the patch under this agent.
End description


Begin NetLogo code:
substitute-text-area-for color-of-patch red        
set pcolor color-of-patch
End NetLogo code


Named colours are black, white, gray, red, orange, brown, yellow, green, lime, turquoise, cyan, sky, blue, violet, magenta, and pink. More colors can be specified. One way is to specify a list of three numbers that indicate the intensity of the red, green, and blue components of the color. 0 is for none while 255 is for maximum. To pick a random colour replace the contents of the edit box with

(list random-integer-between 0 255  ; red
      random-integer-between 0 255  ; green
      random-integer-between 0 255) ; blue

How this works

This sets the NetLogo primitive attribute pcolor to the specified color.

Related micro-behaviours


Patch color was implemented by Ken Kahn.

BehaviourComposer: ignore everything after this.