Template:ColorString/doc
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; - "
- "
e
" only when the second code is "T": an "e" will display a bordered example of the file
The second code specifies
- a "
- a "
C
" for {{Legend}} but Text "Colors" with parameter pairs, - a "
D
" for {{ColorBox}} with (tincture) parameter pairs, - a "
M
" or "-
" for {{Legend-small}} with parameter pairs, - a "
T
" for template:{{Tbc}} always with parameter pairs, - a "
B
" for {{ColorBox}} with single parameter values "B" is usable for non-standard tinctures - a "
L
" for {{Legend}} with single parameter values, ¹) - a "
S
" for {{Legend-small}} with single parameter values.
- ¹) the "L" possibility exists just for completion – normally a "Legend" without an explaining second value will not be useful.
", "C
", "D
", "-
", "M
", "T
") should contain an URL addressin 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.
It is also possible to use the striped
option for Legends (second code " ", "C" or none).
It can be specified in the first parameter, the color, by prefixing it with 1)
, 2)
or 3)
.
{{ColorString|2)red/striped-2}} | gives
striped-2 |
Examples
[edit]See there an example with many colors. See there examples for Tbc parametrizing. See a 16 × 16 × 16 table.
This parameter string... | ...yields: |
---|---|
#FF0
|
#FF0 |
/B/vert/#396
|
vert#396 |
/D/#BC3F4A/sanguine
|
sanguine |
lime/{{W|green}} /#0f47af/azure /#DA121A/gules /#999/{{Wf|cendrée}} |
azure gules
|
with hex codes (and pipes):-|S|#000|#00f|#F0F|#396
|
#000 #00f #F0F #396
|
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 |
brunâtre murrey orange_t
sanguine |
with the CSS color names:/S/black/silver/maroon/red/ green/lime/olive/yellow/ navy/blue/purple/fuchsia/ teal/aqua/gray/olivedrab/ azure_CSS |
black silver maroon red green lime olive yellow navy blue purple fuchsia teal aqua gray olivedrab azure_CSS
|
with URL addresses and other links|M|Peru|{{W|Peru}}|plum|{{Plainlinks| https://en.wikipedia.org/wiki/Plum| URL1}}|crimson}} |
crimson
|
with the striping option1)sable/striped-1/ 2)black/black/ 3)#000/striped-3 |
striped-1 black
striped-3 |