Difference between revisions of "Colors"

From Tales of Maj'Eyal
Jump to: navigation, search
m
m (How to add own colours.)
 
Line 62: Line 62:
 
</table>
 
</table>
  
 +
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".
 
{{Module Guides}}
 
{{Module Guides}}

Latest revision as of 20:46, 8 March 2014

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

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

The following colors are defined by T-Engine 1.0.4:

NameRedGreenBlueDemo
BLACK000    
WHITE255255255    
SLATE140140140    
ORANGE2551190    
RED20100    
GREEN013469    
BLUE00227    
UMBER142690    
LIGHT_DARK808080    
LIGHT_SLATE209209209    
VIOLET1920175    
YELLOW2552550    
LIGHT_RED2550104    
LIGHT_GREEN02550    
LIGHT_BLUE81221255    
LIGHT_UMBER21514269    
DARK_UMBER879437    
DARK_GREY676767    
GREY127127127    
ROYAL_BLUE65105225    
AQUAMARINE127255212    
CADET_BLUE95158160    
STEEL_BLUE70130180    
TEAL0128128    
LIGHT_STEEL_BLUE176196222    
DARK_BLUE00147    
ROYAL_BLUE0108255    
PINK255192203    
GOLD2552150    
FIREBRICK1783434    
DARK_RED10000    
VERY_DARK_RED5000    
CRIMSON2202060    
MOCCASIN255228181    
KHAKI240230130    
SANDY_BROWN24416496    
SALMON250128114    
DARK_ORCHID15350204    
ORCHID218112214    
PURPLE1280139    
CHOCOLATE21010530    
DARK_KHAKI189183107    
TAN210180140    
DARK_TAN1108040    
HONEYDEW240255240    
ANTIQUE_WHITE250235215    
OLD_LACE253245230    
DARK_SLATE_GRAY477979    
OLIVE_DRAB10714235    
DARK_SEA_GREEN143188143    
YELLOW_GREEN15420550    
DARK_GREEN507712    

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".