

When turtles move, they change the brightness or saturation of the patch beneath their path.įor more information, see the palette extension documentation. In the GO procedure, the model creates new turtles to keep the turtle count at NUM-TURTLES. The model uses these commands to change the color of turtles and patches: In this example, we use the primitives to set the components of an agent's color. The set component primitive group directly changes the component of a color without the list manipulations (which in the previous versions of the extension were required). The model uses a color scheme for patches and turtles. This primitive reports a color scheme from Color Brewer, an online color suggestion tool. It uses a few primitive groups from the palette extension: palette:scheme-colors This model uses primitives that modify saturation, brightness, and transparency (a number from 0 to 100 that measures the transparency of a color). As they move, they lose energy and fade away. Turtles move around the space and raise the saturation or brightness of patches they cross over, revealing a colorful layout.
#NETLOGO COLORS DOWNLOAD#
Note: If you download the NetLogo application, every model in the Models Library is included.Ĭolor Reveal demonstrates commands from version 2.0.0 of the palette extension. However, if there is a green plant on the same patch, our sheep eats the green plant.Beginners Interactive NetLogo Dictionary (BIND)Ĭode Examples/Extensions Examples/palette When there is a yellow plant on the same patch, our sheep just ignores it. We use the ask turtles with to just ask the sheep to move, while the plants remain stationary. Turtle, link, and label color values can contain lists of numbers which represent either RGB or RGBA colors, that is, red, green, and blue, or red, green, blue, and alpha. We use the color primitive to make some of the plants green and some yellow. In the model example below, we have a white sheep and some plants. For example, if we wanted to create a traffic model. using rgb colors: set pcolor r g b or set color r g b. scale-color is a primitive that reports a shade of a color proportional to the value of a given number. You can also use non-integer numbers to achieve an even more precise color such as red + 0.25or blue - 1.85. - using NetLogo colors: set pcolor color or set color color. For example, green + 2is will result in a lighter green color, while green - 2 will result in a darker green. This allows us to manipulate the lightness of colors with simple math. As NetLogo uses a simple numbering scheme for colors, you can actually treat color names like numerical values. The speed slider allows you to control the speed of a model, that is, the speed at which turtles move, patches change color, and so on.You should write the name of a color directly, without any quotations around the color name ( "").These names are: red, green, blue, brown, black, pink, white, violet, magenta, cyan, and gray. Because this model depends on interaction with the user, we measure the passage of time in seconds. As you noticed in the examples above, you can use the names of the common colors directly in your code. NETLOGO FEATURES import-drawing is the primitive that loads the image into the drawing, which in this case is merely a backdrop instead of something agents actually draw in.

You can access this color numbering scheme by clicking the Tools menu and choosing the Color Swatches option.

NetLogo uses a custom numbering scheme to represent colors.ask turtles [Ĭolor is also a reporter we can use it to access the color of a turtle as follows: ask turtles with [ We can use the set primitive and the color primitive together to change a turtle's color as follows: set color red. We are currently re-designing the color picker for NetLogo Web, which has been different from NetLogo Desktop for a while. Every time we create new turtles, each one is assigned a random color. Color is a built-in turtle characteristic that represents the color of each turtle in a NetLogo model.
