Template:Infobox nc: Difference between revisions
m (more missing item categories) |
(added use of lc, to convert input to lowercase & more accepted inputs) |
||
Line 1: | Line 1: | ||
<includeonly>{{#switch: {{{2|}}} | <includeonly>{{#switch: {{lc:{{{2|}}}}} | ||
|text={{#switch: {{lc:{{{1|}}}}} | |||
| | |weapon |weapon - crafted |weaponcrafted |tool |tool/weapon |toolweapon |material |food |drink |literature |book |clothing |bag |baggage |container |medical |health |firstaid |first aid |vehicle |vehicles |mechanics |mechanic |construction |earth |carpentry |metalworking |water |aqua |gardening |farming |farm |grass |outdoors |electronics |electricity |electrical |electric |engineering |community |#default = FFFFFF | ||
}} | }} | ||
|link={{#switch: {{lc:{{{1|}}}}} | |||
| | |weapon |weapon - crafted |weaponcrafted = D8AD51 | ||
| | |tool |tool/weapon |toolweapon |material |food |drink |literature |book |clothing |bag |baggage |container |medical |health |firstaid |first aid |vehicle |vehicles |mechanics |mechanic |construction |earth |carpentry |metalworking |water |aqua |gardening |farming |farm |grass |outdoors |electronics |electricity |electrical |electric |engineering = D5D0C5 | ||
|community = C1D6DD | |||
|#default = DDD6C1 | |#default = DDD6C1 | ||
}} | }} | ||
|light={{#switch: {{lc:{{{1|}}}}} | |||
| | |weapon |weapon - crafted |weaponcrafted = B3525D | ||
| | |tool |tool/weapon |toolweapon |material = 6B87B9 | ||
|food |drink = 6BB994 | |||
|literature |book = B99F6B | |||
|clothing |bag |baggage |container = 826BB9 | |||
|medical |health |firstaid |first aid = B96B7C | |||
|vehicle |vehicles |mechanics |mechanic = 8A9A92 | |||
|construction |earth |carpentry |metalworking = 8B6E51 | |||
|water |aqua = 4B7682 | |||
|gardening |farming |farm |grass |outdoors = 4A7E49 | |||
|electronics |electricity |electrical |electric |engineering = E0A64B | |||
|community = 185893 | |||
|#default = B22328 | |#default = B22328 | ||
}} | }} | ||
|dark={{#switch: {{lc:{{{1|}}}}} | |||
| | |weapon |weapon - crafted |weaponcrafted = 440000 | ||
| | |tool |tool/weapon |toolweapon |material = 2F3F5D | ||
|food |drink = 2F5D47 | |||
|literature |book = 5D4E2F | |||
|clothing |bag |baggage |container = 3C2F5D | |||
|medical |health |firstaid |first aid = 5D2F39 | |||
|vehicle |vehicles |mechanics |mechanic = 414A46 | |||
|construction |earth |carpentry |metalworking = 463423 | |||
|water |aqua = 213A41 | |||
|gardening |farming |farm |grass |outdoors = 203F20 | |||
|electronics |electricity |electrical |electric |engineering = 84451A | |||
|community = 185893 | |||
|#default = 360000 | |#default = 360000 | ||
}} | }} | ||
|body={{#switch: {{lc:{{{1|}}}}} | |||
| | |weapon|weapon - crafted |weaponcrafted = F2E6E7 | ||
| | |tool|tool/weapon|toolweapon|material = E6EAF2 | ||
|food|drink = E6F2EC | |||
|literature|book = F2EDE6 | |||
|clothing|bag|baggage|container = EAE6F2 | |||
|medical|health|firstaid|first aid = F2E6E9 | |||
|vehicle|vehicles|mechanics|mechanic = E6F2EC | |||
|construction|earth|carpentry|metalworking = E6F0F2 | |||
|water|aqua = E6EFF2 | |||
|gardening|farming|farm|grass|outdoors = E7F2E6 | |||
|electronics|electricity|electrical|electric|engineering| = EFEBE3 | |||
|community = EBF3F4 | |||
|#default = F4F3EB | |#default = F4F3EB | ||
}} | }} | ||
|#default={{#switch: {{{1|}}} | |#default={{#switch: {{lc:{{{1|}}}}} | ||
| | |weapon|weapon - crafted |weaponcrafted = 931E2B | ||
| | |tool|tool/weapon|material = 4F6999 | ||
|food|drink = 4F9976 | |||
|literature|book = 99814F | |||
|clothing|bag|baggage|container = 654F99 | |||
|medical|health|firstaid|first aid = 994F5F | |||
|vehicle|vehicles|mechanics|mechanic = 6C7B74 | |||
|construction|earth|carpentry|metalworking = 73583B | |||
|water|aqua = 375F6B | |||
|gardening|farming|farm|grass|outdoors = 356835 | |||
|electronics|electricity|electrical|electric|engineering = C77E37 | |||
|community = 185893 | |||
|#default = 68191B | |#default = 68191B | ||
}} | }} | ||
}}</includeonly><noinclude>{{Protection}}{{Documentation}}[[Category:Metatemplates]]</noinclude> | }}</includeonly><noinclude>{{Protection}}{{Documentation}}[[Category:Metatemplates]]</noinclude> |
Revision as of 05:03, 1 January 2024
This page has been put into protection by a PZwiki administrator.
Only users in the sysop user group may edit this page.
The
{{Infobox nc}}
template is used to output a hex code based on the input.
Usage
The intended use is inside CSS "style" attributes to define the "color" element, outputing the appropriate hex code.
Example | Produces | Description |
---|---|---|
{{Infobox nc|Weapon}}
|
B3525D | The value in the first position is used to define the color category, then the second position defines the color type. The output is a hex value. |
{{Infobox nc}}
|
68191B | Defining no values will return the default hex value. |
<span style="background-color: #{{Infobox nc|Weapon|Dark}}; color: #{{Infobox nc|Weapon|Text}};"> EXAMPLE </span> |
EXAMPLE | Here we've used a span tag with the template defining the value of the "color" and "background-color" properties. |
[[Project Zomboid Wiki|<span style="background-color: #{{Infobox nc|Community}}; color: #{{Infobox nc|Community|Link}};"> EXAMPLE </span>]] |
EXAMPLE | Again, using the span tag we've defined the "color" and "background-color" properties, but this time by putting it inside the wikilink we can define the color of the link text. |
Parameters
The below table shows the inputs (color category and type) and the corresponding hex codes that are output.
Parameter | Description | Status |
---|---|---|
1
|
Used to define the color category. e.g. "Weapon". | required |
2
|
Used to pick the color type. e.g. "Light" or "Text". | optional |
Accepted values
Color category (1) | Color type (2) | |||||
---|---|---|---|---|---|---|
Dark | Normal | Light | Body | Text | Link | |
Weapon
|
440000 | 931E2B | B3525D | F2E6E7 | FFFFFF | D8AD51 |
Tool
|
2F3F5D | 4F6999 | 6B87B9 | E6EAF2 | FFFFFF | D5D0C5 |
Food
|
2F5D47 | 4F9976 | 6BB994 | E6F2EC | FFFFFF | D5D0C5 |
Literature
|
5D4E2F | 99814F | B99F6B | F2EDE6 | FFFFFF | D5D0C5 |
Clothing
|
3C2F5D | 654F99 | 826BB9 | EAE6F2 | FFFFFF | D5D0C5 |
FirstAid
|
5D2F39 | 994F5F | B96B7C | F2E6E9 | FFFFFF | D5D0C5 |
Vehicle
|
414A46 | 6C7B74 | 8A9A92 | E6F2EC | FFFFFF | D5D0C5 |
Construction
|
463423 | 73583B | 8B6E51 | E6F0F2 | FFFFFF | D5D0C5 |
Water
|
213A41 | 375F6B | 4B7682 | E6EFF2 | FFFFFF | D5D0C5 |
Gardening
|
203F20 | 356835 | 4A7E49 | E7F2E6 | FFFFFF | D5D0C5 |
Electronics
|
84451A | C77E37 | E0A64B | EFEBE3 | FFFFFF | D5D0C5 |
Community
|
185893 | 185893 | 185893 | EBF3F4 | FFFFFF | C1D6DD |
default | 360000 | 68191B | B22328 | F4F3EB | FFFFFF | DDD6C1 |
Documentation transcluded from Template:Infobox nc/doc.
Editors can experiment in this template's sandbox (create)
Editors can experiment in this template's sandbox (create)