Home Download Help Forum Resources Extensions FAQ NetLogo Publications Contact Us Donate Models: Library Community Modeling Commons Beginners Interactive NetLogo Dictionary (BIND) NetLogo Dictionary User Manuals: Web Printable Chinese Czech Farsi / Persian Japanese Spanish
|
NetLogo Models Library: |
Note: If you download the NetLogo application, every model in the Models Library is included. |
This model demonstrates the use of groups of commands from version 2.0.0 of the palette
extension. By moving their mouse the user changes the hue of background patches as well as the hue and brightness of nearby turtles. Hue, Saturation, and Brightness are referred to as "components" of the colors.
This model changes the hue, saturation, and brightness of colors by using these primitive groups:
component-of
PrimitivesThe component of primitive group reports a particular component of an RGB/A or NL color. The model uses this group in the CODE tab to access sepcific components of PAINT-COLOR in the CODE. It uses these commands:
palette:hue-of
colorpalette:saturation-of
colorpalette:brightness-of
colorwith-component
PrimitivesThe with component primitive group reports the color with the component changed to number while leaving the other components unchanged. This model uses the command to change the components of PAINT-COLOR in the CODE tab. It uses these commands:
palette:with-hue
numberpalette:with-saturation
numberpalette:with-brightness
numberset-component
PrimitivesThe 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). In this example, we use the primitives to set the components of an agent's color. The model uses these commands to change the color of turtles and patches:
palette:set-hue
numberpalette:set-saturation
numberpalette:set-brightness
numberColor Painting also makes use of NetLogo mouse primitives in the CODE tab to manage mouse input.
For more information on the palette
commands, see the palette
extension documentation.
(back to the NetLogo Models Library)