Difference between revisions of "Colors"
From Tales of Maj'Eyal
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:
Name | Red | Green | Blue | Demo |
---|---|---|---|---|
BLACK | 0 | 0 | 0 | |
WHITE | 255 | 255 | 255 | |
SLATE | 140 | 140 | 140 | |
ORANGE | 255 | 119 | 0 | |
RED | 201 | 0 | 0 | |
GREEN | 0 | 134 | 69 | |
BLUE | 0 | 0 | 227 | |
UMBER | 142 | 69 | 0 | |
LIGHT_DARK | 80 | 80 | 80 | |
LIGHT_SLATE | 209 | 209 | 209 | |
VIOLET | 192 | 0 | 175 | |
YELLOW | 255 | 255 | 0 | |
LIGHT_RED | 255 | 0 | 104 | |
LIGHT_GREEN | 0 | 255 | 0 | |
LIGHT_BLUE | 81 | 221 | 255 | |
LIGHT_UMBER | 215 | 142 | 69 | |
DARK_UMBER | 87 | 94 | 37 | |
DARK_GREY | 67 | 67 | 67 | |
GREY | 127 | 127 | 127 | |
ROYAL_BLUE | 65 | 105 | 225 | |
AQUAMARINE | 127 | 255 | 212 | |
CADET_BLUE | 95 | 158 | 160 | |
STEEL_BLUE | 70 | 130 | 180 | |
TEAL | 0 | 128 | 128 | |
LIGHT_STEEL_BLUE | 176 | 196 | 222 | |
DARK_BLUE | 0 | 0 | 147 | |
ROYAL_BLUE | 0 | 108 | 255 | |
PINK | 255 | 192 | 203 | |
GOLD | 255 | 215 | 0 | |
FIREBRICK | 178 | 34 | 34 | |
DARK_RED | 100 | 0 | 0 | |
VERY_DARK_RED | 50 | 0 | 0 | |
CRIMSON | 220 | 20 | 60 | |
MOCCASIN | 255 | 228 | 181 | |
KHAKI | 240 | 230 | 130 | |
SANDY_BROWN | 244 | 164 | 96 | |
SALMON | 250 | 128 | 114 | |
DARK_ORCHID | 153 | 50 | 204 | |
ORCHID | 218 | 112 | 214 | |
PURPLE | 128 | 0 | 139 | |
CHOCOLATE | 210 | 105 | 30 | |
DARK_KHAKI | 189 | 183 | 107 | |
TAN | 210 | 180 | 140 | |
DARK_TAN | 110 | 80 | 40 | |
HONEYDEW | 240 | 255 | 240 | |
ANTIQUE_WHITE | 250 | 235 | 215 | |
OLD_LACE | 253 | 245 | 230 | |
DARK_SLATE_GRAY | 47 | 79 | 79 | |
OLIVE_DRAB | 107 | 142 | 35 | |
DARK_SEA_GREEN | 143 | 188 | 143 | |
YELLOW_GREEN | 154 | 205 | 50 | |
DARK_GREEN | 50 | 77 | 12 |
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".