Colors

AnyLogic enables users to choose any colors they like for their graphical elements. This can be done using the Colors dialog box.

The most popular colors are listed on the Standard page of the Colors dialog (see figure below).

In the case you want to use some other color, you can choose it on the Spectrum page of the dialog by dragging the handle in the Colors area, or specifying Red, Green and Blue color components evidently. 

   A B C D E F G H I J  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 _

Set of standard colors (as shown in the Colors dialog)

In the case you want to dynamically switch to some of these standard colors, you may refer to the required color using the name of the corresponding constant. The table below lists the names of color constants for all the standard colors shown above. Use indexes (A..J, 1..14) to find the correspondence between cells of these tables.

Color constants

A B C D E F G H I J
1 black darkGray dimGray gray silver lightGrey gainsboro whiteSmoke white red
2 darkRed maroon fireBrick brown indianRed lightCoral rosyBrown snow mistyRose salmon
3 tomato darkSalmon coral orangeRed lightSalmon feldspar sienna seaShell saddleBrown chocolate
4 sandyBrown peachPuff peru linen bisque darkOrange burlyWood tan antiqueWhite navajoWhite
5 blanchedAlmond papayaWhip moccasin orange wheat oldLace floralWhite darkGoldenRod goldenRod cornsilk
6 gold khaki lemonChiffon paleGoldenRod darkKhaki yellow olive lightGoldenRodYellow lightYellow beige
7 ivory oliveDrab yellowGreen darkOliveGreen greenYellow chartreuse lawnGreen lime green darkGreen
8 limeGreen forestGreen lightGreen paleGreen darkSeaGreen honeyDew seaGreen mediumSeaGreen springGreen mintCream
9 mediumSpringGreen mediumAquaMarine aquamarine turquoise lightSeaGreen mediumTurquoise cyan darkCyan teal darkSlateGray
10 paleTurquoise lightCyan azure darkTurquoise cadetBlue powderBlue lightBlue deepSkyBlue skyBlue lightSkyBlue
11 steelBlue dodgerBlue lightSlateGray slateGray lightSteelBlue cornflowerBlue royalBlue blue mediumBlue darkBlue
12 navy midnightBlue lavender ghostWhite slateBlue lightSlateBlue darkSlateBlue mediumSlateBlue mediumPurple blueViolet
13 indigo darkOrchid darkViolet mediumOrchid magenta darkMagenta purple violet plum thistle
14 orchid violetRed mediumVioletRed deepPink hotPink paleVioletRed lavenderBlush crimson pink lightPink

Plus to the “classical” colors listed above, you can use any other "custom" colors. You create your color as the instance of standard Java class Color

Defining custom colors dynamically

Defining transparent colors

Please note that transparent elements take significantly longer time to draw and may therefore slow down the model execution.

Making elements' components invisible at runtime

Please see Java documentation on class Color for more information.

Related topics

 Textures