- v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
- Use this page to report any issues related to the migration.
Difference between revisions of "40d:Color"
Untelligent (talk | contribs) (Separated the dye color tokens from the new "interesting effects" section.) |
|||
Line 105: | Line 105: | ||
There's also a one-argument form of the <code>COLOR</code> flag used to define the color of gems. In that case the argument is the foreground color, the background color is variable and the brightness of gems is always 1. | There's also a one-argument form of the <code>COLOR</code> flag used to define the color of gems. In that case the argument is the foreground color, the background color is variable and the brightness of gems is always 1. | ||
− | ==Interesting Color Effects== | + | ===Interesting Color Effects=== |
− | ===Values 8-15=== | + | ====Values 8-15==== |
Setting the value of the foreground or background color to anything from 8 to 15, with the brightness value at Zero, appears to set it to the same colors of the "standard" values of 0-7, in the same order. However, the brightness value will effectively be Nonzero. Although this may not seem very interesting at first, it also applies to background color, meaning that you can use this trick to give the background a "bright" color, which is not possible using the standard values. | Setting the value of the foreground or background color to anything from 8 to 15, with the brightness value at Zero, appears to set it to the same colors of the "standard" values of 0-7, in the same order. However, the brightness value will effectively be Nonzero. Although this may not seem very interesting at first, it also applies to background color, meaning that you can use this trick to give the background a "bright" color, which is not possible using the standard values. | ||
Line 112: | Line 112: | ||
Setting the foreground or background color to 8-15 and setting the brightness to Nonzero has unusual effects that appear to affect both colors, even if one of them is a "standard" value. | Setting the foreground or background color to 8-15 and setting the brightness to Nonzero has unusual effects that appear to affect both colors, even if one of them is a "standard" value. | ||
− | ===Values higher than 15:=== | + | ====Values higher than 15:==== |
Setting the foreground value to anything higher than 15 has an odd effect. It changes the set color to match the same color of the ground the creature is standing on. This means that if the creature's foreground color is set to 16 and the creature is standing on black sand, then their tile will turn the color black to match the sand. | Setting the foreground value to anything higher than 15 has an odd effect. It changes the set color to match the same color of the ground the creature is standing on. This means that if the creature's foreground color is set to 16 and the creature is standing on black sand, then their tile will turn the color black to match the sand. |
Revision as of 18:00, 13 September 2008
Color is used to express various information, from a dwarf's profession, over the natural color of a terrain feature to the material an item is made of.
You may be looking for Color schemes, which contains color schemes different from DF's default.
Modding color
Various moddable files use one of the the two color definitions below.
Color flags
Colors are primarily defined using the [COLOR:foreground:background:brightness] flag. The three arguments are:
- Foreground color [0-7]
- Background color [0-7]
- Brightness of the foreground color [0 or 1]
The brightness of the background color is always 0.
The following colors can be displayed:
|
|
Sometimes the color numbers are part of another flag, e.g. the last three arguments of [EXTRACT:golden salve:6:0:1]
express the color yellow on black.
There's also a one-argument form of the COLOR
flag used to define the color of gems. In that case the argument is the foreground color, the background color is variable and the brightness of gems is always 1.
Interesting Color Effects
Values 8-15
Setting the value of the foreground or background color to anything from 8 to 15, with the brightness value at Zero, appears to set it to the same colors of the "standard" values of 0-7, in the same order. However, the brightness value will effectively be Nonzero. Although this may not seem very interesting at first, it also applies to background color, meaning that you can use this trick to give the background a "bright" color, which is not possible using the standard values.
Setting the foreground or background color to 8-15 and setting the brightness to Nonzero has unusual effects that appear to affect both colors, even if one of them is a "standard" value.
Values higher than 15:
Setting the foreground value to anything higher than 15 has an odd effect. It changes the set color to match the same color of the ground the creature is standing on. This means that if the creature's foreground color is set to 16 and the creature is standing on black sand, then their tile will turn the color black to match the sand.
Setting the background value has the same effect, but since almost all (if not all) walkable tiles have a black background, the creature's background will probably be black in all cases except on the unit list.
Note: setting the brightness value to anything other than 0 or 1 appears to act as 1. This is probably because it only checks for zero or nonzero numbers.
Color tokens
Dyes do not use color flags, they reference color tokens defined in descriptor_color_standard.txt. Color tokens are simply referenced by the token name, e.g. [MILL_DYE:EMERALD]
.
The following colors are defined via tokens:
|
|