Template:Igen/cbx

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

This Image generation subtemplate performs a display of color boxes, by e.g. {{Legend}}.

Transclusion (Igen):

{{ Igencb = textstring }}

  • only one parameter: either a color name (e.g. "lime") or a color triplet (e.g. "#FC23C4" or "#F0F")
  • a parameter pair, like above plus a display text separated by a slash "/",
or the slash only for an empty second parameter (the first parameter will be used)
  • more parameters pairs, like that, separated by slashes

In any of these cases this string can be preceded by a control code pair, e.g. "+/ ";
the first code may be missing, or a "+" to generate a field name; the second parameter may be

¹) the "-" possibility can also be expressed with an "M" or "C" (caption "Color")
²) the "L" possibility exists just for completion – normally a "Legend" without an explaining second value will not be useful.
Transclusion (Igen/cbx)

All slashes are replaced by pipes, so this template gets a row of unnamed parameters.
When the second parameter of a pair is missing, the first parameter will be displayed instead.
When the first parameter of such a pair is empty, the template terminates.
Template Igen/cbox and LUA module Color2dec is used.

See examples at Template:ColorString 0 and its talk page;0 see more examples at Wikimedia icons.