Return to Manual Index

Colors

Implementation: engine.colors

Usage

T-Engine provides a number of predefined colors. There are two ways to refer to these:

  • In your Lua code. For example: color.DARK_GREEN
  • Embedded within strings (using # signs to mark them). For example: "Hello, #BLUE#world#LAST#!"

You can add your own colours to the list for your module by adding in a line like the following to the /load.lua file:

defineColor('MAUVE', 204, 153, 255)

References to "MAUVE" will then result in this colour. You can define as many colours with as many names as you like. It can sometimes to helpful to name the colours based on what they're used for rather than the colours themselves. Eg, a colour for lightning attacks could be called "LIGHTNING".

Presets

The following colors are defined by T-Engine 4:

NameRedGreenBlueDemo
BLACK000
WHITE0xFF0xFF0xFF
SLATE0x8C0x8C0x8C
ORANGE0xFF0x770x00
RED0xC90x000x00
GREEN0x000x860x45
BLUE0x000x000xE3
UMBER0x8E0x450x00
LIGHT_DARK0x500x500x50
LIGHT_SLATE0xD10xD10xD1
VIOLET0xC00x000xAF
YELLOW0xFF0xFF0x00
LIGHT_RED0xFF0x000x68
LIGHT_GREEN0x000xFF0x00
LIGHT_BLUE0x510xDD0xFF
LIGHT_UMBER0xD70x8E0x45
DARK_UMBER0x570x5E0x25
DARK_GREY676767
GREY127127127
ROYAL_BLUE65105105
AQUAMARINE127255255
CADET_BLUE95158158
STEEL_BLUE70130130
TEAL0128128
LIGHT_STEEL_BLUE176196196
DARK_BLUE0x000x000x93
ROYAL_BLUE0x000x6C0xFF
PINK255192192
GOLD255215215
FIREBRICK1783434
DARK_RED10000
VERY_DARK_RED5000
CRIMSON2202020
MOCCASIN255228228
KHAKI240230230
SANDY_BROWN244164164
SALMON250128128
DARK_ORCHID1535050
ORCHID218112112
PURPLE12800
CHOCOLATE210105105
DARK_KHAKI189183183
TAN210180180
DARK_TAN1108080
HONEYDEW240255255
ANTIQUE_WHITE250235235
OLD_LACE253245245
DARK_SLATE_GRAY477979
OLIVE_DRAB107142142
DARK_SEA_GREEN143188188
YELLOW_GREEN154205205
DARK_GREEN507777
generated by LDoc 1.4.3