Template:ColorBracket
From HorizonXI Wiki
Usage
This template is meant to show what a color value will look like. It outputs a span with the background set to the provided color. Custom display text may also be provided.
- Parameter 1: The color to use.
- Parameter 2: Use color value as the display text.
- If any value is provided, such as Y, then the value from Parameter 1 will be shown in the brackets, and Parameter 3 will be ignored.
- If not provided, Parameter 3 will be used.
- Parameter 3: Custom display text.
- If not provided, 8 non-breaking spaces will be used.
A typical use for this template would be in the usage documentation of another template that accepts a color parameter, but a default will be used if not provided. Refer to the Examples below for details.
Syntax:
{{ColorBracket|COLOR_VALUE|USE_COLOR|CUSTOM_TEXT}}
Examples
Color Only
- Only provides the color value.
Usage:
* '''MyColorParm''': Some color value.<br/>''Default value is #FF0000'': {{ColorBracket|#FF0000}}
Output:
- MyColorParm: Some color value.
Default value is #FF0000: [ ]
Color as Text
- Color value and flag to use it as the display text.
Usage:
* '''MyColorParm''': Some color value.<br/>''Default value is #FF0000'': {{ColorBracket|#FF0000|Y}}
Output:
- MyColorParm: Some color value.
Default value is #FF0000: [ #FF0000 ]
Custom Text
- Color value and custom text. Note that the 2nd parameter is empty.
Usage:
* '''MyColorParm''': Some color value.<br/>''Default value is #FF0000'': {{ColorBracket|#FF0000||Sample Text}}
Output:
- MyColorParm: Some color value.
Default value is #FF0000: [ Sample Text ]
Default Output
[ ]