Template:Color box/doc
{{#ifeq:doc |doc
|
{{#ifeq:show |show
|
| icon | This is a documentation subpage for Template:Terminate sentence It may contain usage information, categories and other content that is not part of the original {{#if: |{{{text2}}} |{{#if: |{{{text1}}} |{{#ifeq:Template |User |template template page |{{#if:Template |template page|article}}}}}}}}. |
}}{{#if:|
|{{#ifexist:Template:Color box
| [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
|
}}
}}
|
}}
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.
| Warning | This template is used on approximately 86,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
Usage
{{#ifeq:{{safesubst:#switch: {{{header}}}
|no |n |f |false |off |0 = no | = yes |¬ = yes |yes |y |t |true |on |1 = yes |#default = yes
}}|yes|
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AColor+box%7CColor+box%7CColor+box%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|S|s}}ee a monthly parameter usage report] for {{#if:Color box|Template:Color box|this template}} in articles{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Color box|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AColor+box%7CColor+box%7CColor+box%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Color box|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AColor+box%7CColor+box%7CColor+box%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report] for {{#if:Color box|Template:Color box|Template:Color box}}{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Color box|its|this}} TemplateData}}.
|#default=[1]{{#ifeq:{{safesubst:#switch: y |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Color box|its|this}} TemplateData}} }}|This is the {{#if:|TemplateData|TemplateData}} for this template used by TemplateWizard, VisualEditor and other tools. {{#switch:
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AColor+box%7CColor+box%7CColor+box%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|S|s}}ee a monthly parameter usage report] for {{#if:Color box|Template:Color box|this template}} in articles{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Color box|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AColor+box%7CColor+box%7CColor+box%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Color box|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AColor+box%7CColor+box%7CColor+box%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report] for {{#if:Color box|Template:Color box|Template:Color box}}{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Color box|its|this}} TemplateData}}.
|#default=[2]{{#ifeq:{{safesubst:#switch: y |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Color box|its|this}} TemplateData}} }}}}
TemplateData for Color box
{{#switch:
{{#if:
| {{{demospace}}}
| {{#ifeq:Template|Template
| template
| other
}}
}}
| template = {{safesubst:#if:{{safesubst:#ifeq:doc|sandbox|1}}{{safesubst:#ifeq:doc|doc|1}}||
}} | other | #default = }}
}}
{{color box|color|text|text color}}Adds a rectangular color box.
- Colors are most commonly specified as either a color keyword or as the hexadecimal triplet representing an RGB combination. See the article web colors for details.
- If specified, the text is centered within the box.
| ⧼templatedata-doc-param-name⧽ | ⧼templatedata-doc-param-desc⧽ | ⧼templatedata-doc-param-type⧽ | ⧼templatedata-doc-param-status⧽ | |
|---|---|---|---|---|
| Color | 1 | Background color of the box.
| ⧼templatedata-doc-param-type-string⧽ | ⧼templatedata-doc-param-status-required⧽ |
| Text | 2 | Adds text inside the box; box is otherwise an empty square.
| ⧼templatedata-doc-param-type-string⧽ | ⧼templatedata-doc-param-status-suggested⧽ |
| Text color | 3 | Sets the color of the text inside the box.
| ⧼templatedata-doc-param-type-string⧽ | ⧼templatedata-doc-param-status-suggested⧽ |
| Border color | border | Sets the color of the border around the box.
| ⧼templatedata-doc-param-type-string⧽ | ⧼templatedata-doc-param-status-optional⧽ |
| Visual effect | Markup | ||
|---|---|---|---|
| {{#if: | {{{2}}}| {{{2}}} }} | }} | {{color box|Green}}
|
| {{#if:Default color for this text | Default color for this text| Default color for this text }} | }} | {{color box|Yellow|Default color for this text}}
|
| {{#if:Default color for this text | Default color for this text| Default color for this text }} | }} | {{color box|Blue|Default color for this text}}
|
| {{#if:Using X11 color names | Using X11 color names| Using X11 color names }} | }} | {{color box|SteelBlue|'''Using X11 color names'''|Gold}}
|
| {{#if:Using RGB hex triplets | Using RGB hex triplets| Using RGB hex triplets }} | }} | {{color box|#012345|''Using RGB hex triplet''|#FEDCBA}}
|
| {{#if:Red | Red| Red }} | }} | {{color box|Yellow|Red|#f00|border=#f00}}
|
| {{#if:bordercolor like wikitable | bordercolor like wikitable| bordercolor like wikitable }} | }} | {{color box|white|bordercolor like wikitable|border=#A2A9B1}}
|
Variants
| Template | Description | Example | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{Color box}} | Color box size with black borders and text color. Standard size. | {{#if: | {{{2}}}| {{{2}}} }} | }} or {{#if:ORANGE | ORANGE| ORANGE }} | }} | ||||||||||
| {{Color box striped}} | Striped color box. Standard size. | {{{3}}} | }} | ||||||||||||||
| {{RouteBox}} | Borderless color box with text color and wikilinks. | ORANGE | ORANGE }} | ||||||||||||||
| {{Colorbull}} | Colored bullet with wikilinks. | [[{{{3}}}|{{#switch:{{{2}}} | circle|r|round = ● | diamond = ◆ | up|uptriangle = ▲ | dn|downtriangle = ▼ | lt|lefttriangle = ◀ | rt|righttriangle = ▶ | #default = ■
}}]]|{{#switch:{{{2}}} |
circle|r|round = ● | diamond = ◆ | up|uptriangle = ▲ | dn|downtriangle = ▼ | lt|lefttriangle = ◀ | rt|righttriangle = ▶ | #default = ■
}}}} |
| {{Legend inline}} | Color box size with black borders. Standard size. | {{#if: | }} | |||||||||||||
| {{Color sample}} | Color box size with black borders. Smaller size. | |||||||||||||||
| {{Swatch inline}} | orange|orange}} | |||||||||||||||
| {{Background color}} | orange{{safesubst:#switch:
{{safesubst:#if:
|
{{{demospace}}} | main | other
}} }} |
{{#ifexpr:1 < 7 OR 10.634053407262 < 7 AND 1.9747879003183 < 7|}}}} | other | #default =
}}{{#switch: {{#if:
|
{{{demospace}}} | Template | template | other
}} }} |
{{#ifexpr:1 < 7 OR 10.634053407262 < 7 AND 1.9747879003183 < 7|}}}} | other | #default =
}} | ||
| {{Rail color box}} | A version with more display options. Part of Module:Adjacent stations | ●, Orange | ||||||||||||||
| {{Diagonal split color box}} | Color box split diagonally. Standard size. | {{#ifexpr:{{#ifeq: |
0}} and {{#if:|1|0}} | {{#ifeq: | {{#if: | {{{4}}}| }} |
{{#if: | {{{4}}}| }} {{#if:|{{{3}}}| }}
|
{{{4}}}|{{#if:| | }}}} {{#if:|{{{3}}}|{{#if:| | }}}} }}}}
|
Supporting template
See also
- {{Infobox color}}, an infobox for the detailed description of a color.
- {{Legend}}