Template:Infobox nc: Difference between revisions
m (added commuity colour) |
(New colours based on skill books, new accepted values for 2nd anon param (Dark, Light, Body, Link), added documentation template and category) |
||
Line 1: | Line 1: | ||
<includeonly>{{#switch: {{{2|}}} | <includeonly>{{#switch: {{{2|}}} | ||
|text={{#switch: {{{1|}}} | |Text|text={{#switch: {{{1|}}} | ||
| | |||
|Water|water| | |Weapon|weapon|Tool|tool|Food|food|Drink|drink|Literature|literature|Book|book|Clothing|clothing|Bag|bag|Baggage|baggage|Container|container|Medical|medical|Health|health|FirstAid|firstaid|Vehicle|Vehicles|vehicle|vehicles|Mechanics|mechanics|Mechanic|mechanic|Construction|construction|Earth|earth|Carpentry|carpentry|Metalworking|metalworking|Water|water|Aqua|aqua|Gardening|gardening|Farming|farming|Farm|farm|Grass|grass|Outdoors|outdoors|Electronics|electronics|Electricity|electricity|Electrical|electrical|Electric|electric|engineering|Engineering|Community|community|#default = FFFFFF | ||
}} | |||
}} | |Link|link={{#switch: {{{1|}}} | ||
|{{#switch: {{{1|}}} | |Weapon|weapon = D8AD51 | ||
| | |Tool|tool|Food|food|Drink|drink|Literature|literature|Book|book|Clothing|clothing|Bag|bag|Baggage|baggage|Container|container|Medical|medical|Health|health|FirstAid|firstaid|Vehicle|Vehicles|vehicle|vehicles|Mechanics|mechanics|Mechanic|mechanic|Construction|construction|Earth|earth|Carpentry|carpentry|Metalworking|metalworking|Water|water|Aqua|aqua|Gardening|gardening|Farming|farming|Farm|farm|Grass|grass|Outdoors|outdoors|Electronics|electronics|Electricity|electricity|Electrical|electrical|Electric|electric|engineering|Engineering = D5D0C5 | ||
|Book|book| | |Community|community = C1D6DD | ||
|Medical|medical|Health|health| | |#default = DDD6C1 | ||
| | }} | ||
| | |Light|light={{#switch: {{{1|}}} | ||
|Farming|farming|Farm|farm|Grass|grass|Outdoors|outdoors| | |Weapon|weapon = B3525D | ||
| | |Tool|tool = 6B87B9 | ||
| | |Food|food|Drink|drink = 6BB994 | ||
| | |Literature|literature|Book|book = B99F6B | ||
| | |Clothing|clothing|Bag|bag|Baggage|baggage|Container|container = 826BB9 | ||
| | |Medical|medical|Health|health|FirstAid|firstaid = B96B7C | ||
| | |Vehicle|Vehicles|vehicle|vehicles|Mechanics|mechanics|Mechanic|mechanic = 8A9A92 | ||
|Construction|construction|Earth|earth|Carpentry|carpentry|Metalworking|metalworking = 8B6E51 | |||
|Water|water|Aqua|aqua = 4B7682 | |||
|Gardening|gardening|Farming|farming|Farm|farm|Grass|grass|Outdoors|outdoors = 4A7E49 | |||
|Electronics|electronics|Electricity|electricity|Electrical|electrical|Electric|electric|engineering|Engineering = E0A64B | |||
| | |Community|community = 185893 | ||
| | |#default = B22328 | ||
| | }} | ||
| | |Dark|dark={{#switch: {{{1|}}} | ||
| | |Weapon|weapon = 440000 | ||
| | |Tool|tool = 2F3F5D | ||
| | |Food|food|Drink|drink = 2F5D47 | ||
| | |Literature|literature|Book|book = 5D4E2F | ||
| | |Clothing|clothing|Bag|bag|Baggage|baggage|Container|container = 3C2F5D | ||
| | |Medical|medical|Health|health|FirstAid|firstaid = 5D2F39 | ||
| | |Vehicle|Vehicles|vehicle|vehicles|Mechanics|mechanics|Mechanic|mechanic = 414A46 | ||
| | |Construction|construction|Earth|earth|Carpentry|carpentry|Metalworking|metalworking = 463423 | ||
| | |Water|water|Aqua|aqua = 213A41 | ||
| | |Gardening|gardening|Farming|farming|Farm|farm|Grass|grass|Outdoors|outdoors = 203F20 | ||
| | |Electronics|electronics|Electricity|electricity|Electrical|electrical|Electric|electric|engineering|Engineering = 84451A | ||
| | |Community|community = 185893 | ||
| | |#default = 360000 | ||
}} | |||
| | |Body|body={{#switch: {{{1|}}} | ||
| | |Weapon|weapon = F2E6E7 | ||
| | |Tool|tool = E6EAF2 | ||
| | |Food|food|Drink|drink = E6F2EC | ||
| | |Literature|literature|Book|book = F2EDE6 | ||
| | |Clothing|clothing|Bag|bag|Baggage|baggage|Container|container = EAE6F2 | ||
| | |Medical|medical|Health|health|FirstAid|firstaid = F2E6E9 | ||
| | |Vehicle|Vehicles|vehicle|vehicles|Mechanics|mechanics|Mechanic|mechanic = E6F2EC | ||
| | |Construction|construction|Earth|earth|Carpentry|carpentry|Metalworking|metalworking = E6F0F2 | ||
| | |Water|water|Aqua|aqua = E6EFF2 | ||
| | |Gardening|gardening|Farming|farming|Farm|farm|Grass|grass|Outdoors|outdoors = E7F2E6 | ||
| | |Electronics|electronics|Electricity|electricity|Electrical|electrical|Electric|electric|engineering|Engineering = EFEBE3 | ||
| | |Community|community = E6F1F2 | ||
| | |#default = F2F0E6 | ||
| | }} | ||
| | |#default={{#switch: {{{1|}}} | ||
| | |Weapon|weapon = 931E2B | ||
| | |Tool|tool = 4F6999 | ||
| | |Food|food|Drink|drink = 4F9976 | ||
| | |Literature|literature|Book|book = 99814F | ||
| | |Clothing|clothing|Bag|bag|Baggage|baggage|Container|container = 654F99 | ||
| | |Medical|medical|Health|health|FirstAid|firstaid = 994F5F | ||
| | |Vehicle|Vehicles|vehicle|vehicles|Mechanics|mechanics|Mechanic|mechanic = 6C7B74 | ||
| | |Construction|construction|Earth|earth|Carpentry|carpentry|Metalworking|metalworking = 73583B | ||
| | |Water|water|Aqua|aqua = 375F6B | ||
| | |Gardening|gardening|Farming|farming|Farm|farm|Grass|grass|Outdoors|outdoors = 356835 | ||
| | |Electronics|electronics|Electricity|electricity|Electrical|electrical|Electric|electric|engineering|Engineering = C77E37 | ||
| | |Community|community = 185893 | ||
| | |#default = 68191B | ||
| | }} | ||
| | }}</includeonly><noinclude>{{Documentation}}[[Category:Metatemplates]]</noinclude> | ||
| | |||
| | |||
</noinclude> |
Revision as of 17:20, 15 July 2023
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 | E6F1F2 | FFFFFF | C1D6DD |
default | 360000 | 68191B | B22328 | F2F0E6 | 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)