Sets or returns the object's color. Read/write VbtColor.
| VbtColor can be one of the following: |
| vbtAqua Aqua |
| vbtBlack Black |
| vbtBlue Blue |
| vbtBlueGray Blue Gray |
| vbtBrightGreen Bright Green |
| vbtBrown Brown |
| vbtCyan Cyan |
| vbtDarkBlue Dark Blue |
| vbtDarkGray Dark Gray |
| vbtDarkGreen Dark Green |
| vbtDarkRed Dark Red |
| vbtDarkTeal Dark Teal |
| vbtDarkYellow Dark Yellow |
| vbtGold Gold |
| vbtGray Gray |
| vbtGreen Green |
| vbtIndigo Indigo |
| vbtLavender Lavender |
| vbtLightBlue Light Blue |
| vbtLightGray Light Gray |
| vbtLightGreen Light Green |
| vbtLightOrange Light Orange |
| vbtLightTurqoise Light Turqoise |
| vbtLightYellow Light Yellow |
| vbtLime Lime |
| vbtMagenta Magenta |
| vbtOliveGreen Olive Green |
| vbtOrange Orange |
| vbtPaleBlue Pale Blue |
| vbtPink Pink |
| vbtPlum Plum |
| vbtRed Red |
| vbtRose Rose |
| vbtSeaGreen Sea Green |
| vbtSkyBlue Sky Blue |
| vbtTan Tan |
| vbtTeal Teal |
| vbtTurqoise Turqoise |
| vbtViolet Violet |
| vbtWhite White |
| vbtYellow Yellow |
The VisualBots built-in color constants can be used to easily assign colors.
Use the RGB function to create a color value different from the built-in color constants.
The Color property is actually an alias for the FillColor property of the BotShape or CellShape objects when the property applies to a Bot, Cell, Bots, Cells, Group, or Region object.
If the Color property applies to the Screen object, then it is the background color that is displayed when Cell objects are not visible. When the Visible property of a Cell is set to True, then the FillColor of the Cell is displayed.
The following example creates a checkered board pattern by manipulating the Color property of Cells collection object.
Private Sub World1_OnSimBegin(ByVal World As World, ByVal Worms As Bots, ByVal Cells As Cells)
Cells.Color = vbtBlack
For Each Cell in Cells
If IsEven(Cell.RowIndex + Cell.ColumnIndex) then
Cell.Color = vbtRed
End If
Next Cell
End Sub
Function IsEven(ByVal Number as Long) as Boolean
If Number Mod 2 = 0 Then IsEven = true Else IsEven = false
End Function