v50 Steam/Premium information for editors
- 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.
This notice may be cached—the current version can be found here.
Difference between revisions of "Template:C"
Jump to navigation
Jump to search
(DF color style template) |
|||
(3 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | style={{#switch: | + | <includeonly>style="{{#switch: |
{{{1}}} | {{{1}}} | ||
| 0 = color:#000; | | 0 = color:#000; | ||
Line 18: | Line 18: | ||
| f | F = color:#fff;}}{{#switch: | | f | F = color:#fff;}}{{#switch: | ||
{{{2}}} | {{{2}}} | ||
− | | 0 = background-color:#000 | + | | 0 = background-color:#000; |
− | | 1 = background-color:#000080 | + | | 1 = background-color:#000080; |
− | | 2 = background-color:#008000 | + | | 2 = background-color:#008000; |
− | | 3 = background-color:#008080 | + | | 3 = background-color:#008080; |
− | | 4 = background-color:#800000 | + | | 4 = background-color:#800000; |
− | | 5 = background-color:#800080 | + | | 5 = background-color:#800080; |
− | | 6 = background-color:#808000 | + | | 6 = background-color:#808000; |
− | | 7 = background-color:#c0c0c0 | + | | 7 = background-color:#c0c0c0; |
− | | 8 = background-color:#808080 | + | | 8 = background-color:#808080; |
− | | 9 = background-color:#00f | + | | 9 = background-color:#00f; |
− | | a | A = background-color:#0f0 | + | | a | A = background-color:#0f0; |
− | | b | B = background-color:#0ff | + | | b | B = background-color:#0ff; |
− | | c | C = background-color:#f00 | + | | c | C = background-color:#f00; |
− | | d | D = background-color:#f0f | + | | d | D = background-color:#f0f; |
− | | e | E = background-color:#ff0 | + | | e | E = background-color:#ff0; |
− | | f | F = background-color:#fff}}<noinclude>{{documentation}}</noinclude> | + | | f | F = background-color:#fff;}}{{{3|}}}"</includeonly><noinclude>{{documentation}}</noinclude> |
Latest revision as of 21:39, 12 April 2010
(view - edit - history - purge) Documentation
Template:C converts two case-insensitive hex digits into a style for the appropriate DF colors. The colors are:
0 | Black | #000000 |
1 | Blue | #000080 |
2 | Green | #008000 |
3 | Cyan | #008080 |
4 | Red | #800000 |
5 | Magenta | #800080 |
6 | Brown | #808000 |
7 | Light Grey | #c0c0c0 |
8 | Dark Grey | #808080 |
9 | Light Blue | #0000ff |
A | Light Green | #00ff00 |
B | Light Cyan | #00ffff |
C | Light Red | #ff0000 |
D | Light Magenta | #ff00ff |
E | Yellow | #ffff00 |
F | White | #ffffff |
For example, {{c|f|3}} produces style="color:#fff;background-color:#008080;", {{c|7}} produces style="color:#c0c0c0;", and {{c||D}} produces style="background-color:#f0f;". Styles like this can be used in many places. In fact, this template was used to color the table rows above. <span {{c|f|0}}>white text on a black background</span> can be used to color small amounts of text, but the major use is in coloring tables, table rows, and table cells for ASCII diagrams.
Additional style can be added as a third parameter. E.g., {{c|8|0|font-family: Courier New, monospace}}.