Skip to main content

Color

Creates the specified color.

Color block

Description

The Color block creates the specified color. This is a code block part of the Traits drawer.

Usage

Returns a particular color or a color at random chosen from the drop down menu.

Syntax

Inputs in this block:

  • A preloaded color from the dropdown menu

Example

This is a model of bacterial growth and reproduction. Bacteria eat food in order to grow. After eating a sufficient amount, the bacteria will undergo mitosis and split into two new bacterial cells. Each lineage of bacteria has its own color that has been established during setup using the 'color' block.

Color example code

Notes

The Color block provides access to a set of predefined colors that can be selected from a dropdown menu.

  • Color RGB - Create custom colors using RGB values
  • Set My to - Set an agent's color trait
  • My - Access an agent's current color trait