Begin micro-behaviour: Begin description: Change the color of this agent. End description Color Begin NetLogo code: substitute-text-area-for color-of-agent red set color color-of-agent End NetLogo code VariantsYou can use any of these colors: black, white, gray, red, orange, brown, yellow, green, lime, turquoise, cyan, sky, blue, violet, magenta, 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 You can also specify semi-transparent colors. For example, How this worksThis sets the NetLogo primitive attribute color to the specified color. Related micro-behavioursHistoryColor was implemented by Ken Kahn. BehaviourComposer: ignore everything after this. |