Template:ColorString
Template:Lua This template creates one or more color boxes followed by a text string which may contain also wikilinks.
It is also possible to let it create a field name, when used within |other fields 1 or |other fields.
The template has either only one unnamed parameter, a string of possible subparameters separated by slashes,
or unnamed parameters separated by pipes; in both cases an unlimited number of (sub)parameters can be specified.
- Subparameters
are either pairs of colorcode and text, or just the colorcodes. Each valid color code (CSS color names, hex triplet, tincture names) can be used.
The text can be also wiki-formatted, e.g. a link.
In any case, a pair of control codes may precede the string; they are also slash/pipe-separated, e.g. "-/-".
The first code may be (see Igen/cbox)
- "-" or missing: default;
- "+" requesting the generation of a field name
- "e" only when the second code is "T": an "e" will display a bordered example of the file
The second code specifies
- a " " or missing for
"legend" was not recognized as a supported language code."legend" was not recognized as a supported language code. "legend" was not recognized as a supported language code. or "legtab" was not recognized as a supported language code."legtab" was not recognized as a supported language code. "legtab" was not recognized as a supported language code. with parameter pairs,
- a "C" for
"legend" was not recognized as a supported language code."legend" was not recognized as a supported language code. "legend" was not recognized as a supported language code. but Text "Colors" with parameter pairs,
- a "D" for
"colorbox" was not recognized as a supported language code."colorbox" was not recognized as a supported language code. "colorbox" was not recognized as a supported language code. with (tincture) parameter pairs,
- a "M" or "-" for
"legend-small" was not recognized as a supported language code."legend-small" was not recognized as a supported language code. "legend-small" was not recognized as a supported language code. with parameter pairs,
- a "T" for
"tbc" was not recognized as a supported language code."tbc" was not recognized as a supported language code. "tbc" was not recognized as a supported language code. always with parameter pairs,
- a "B" for
"colorbox" was not recognized as a supported language code."colorbox" was not recognized as a supported language code. "colorbox" was not recognized as a supported language code. with single parameter values "B" is usable for non-standard tinctures
- a "L" for
"legend" was not recognized as a supported language code."legend" was not recognized as a supported language code. "legend" was not recognized as a supported language code. with single parameter values, ¹)
- a "S" for
"legend-small" was not recognized as a supported language code."legend-small" was not recognized as a supported language code. "legend-small" was not recognized as a supported language code. with single parameter values.
- ¹) the "L" possibility exists just for completion – normally a "Legend" without an explaining second value will not be useful.
in the second parameter, that is only possible with a parameter list separated by pipes "|".
Otherwise the slashes in the URL address would disturb a slash-separated parameter list.
Whenever possible, the boxes are tooltipped.
Examples
See there an example with many colors. See there examples for Tbc parametrizing.
| This parameter string... | ...yields: |
|---|---|
#FF0
|
#FF0
|
/B/vert/#396
|
Template:ColorBoxTemplate:ColorBox |
/D/#BC3F4A/sanguine
|
Template:ColorBox |
lime/{{W|green}}
/#0f47af/azure
/#DA121A/gules
/#999/{{Wf|cendrée}}
|
Template:Legtab |
with hex codes (and pipes):-|S|#000|#00f|#F0F|#396
|
Template:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-small |
with the (full!) tincture names:argent//argent-d//or// azure//carnation//céleste// cendrée//gules//purpure// sable//tawny//vert |
argent argent-d or azure carnation céleste cendrée gules purpure sable tawny vert
|
with exotic tincture names/L/brunâtre/murrey/ orange_t/sanguine |
Template:Legend/sandboxTemplate:Legend/sandboxTemplate:Legend/sandboxTemplate:Legend/sandbox |
with the CSS color names:/S/black/silver/maroon/red/ green/lime/olive/yellow/ navy/blue/purple/fuchsia/ teal/aqua/gray/olivedrab/ azure_CSS |
Template:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-smallTemplate:Legend-small |
with URL addresses and other links|M|Peru|{{W|Peru}}|plum|{{Plainlinks|
https://en.wikipedia.org/wiki/Plum|
URL1}}|crimson}}
|
Template:Legend-smallTemplate:Legend-smallTemplate:Legend-small |