Template:Tbc

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Tbc/doc.

Table for colors (not an IDC-10 disease)
Creates a table to describe the colors, for flags or other colored items
May be within another table, as a files {{Information}} box or the {{Infobox flag}} description (example)
The displayed color box is tooltipped to show the #rrggbb- or #rgb-color code.

For the R/G/B-values is the decimal notation required, because it is easy to convert decimal to hexadecimal, but very laborious to convert from hexadecimal (see #With Igen).
The hexadecimal values are displayed when the cursor is moved to the box.

Usage

{{Tbc |1= |2= |3= |4= |5= |pixel= }}

Best usage is within the {{Information}} description of the file, using the parameter other_fields (example).
Use bit 8 to create a field name, either with text= or the defaults of {{I18n/Colors}};
otherwise see more about how to use at the documentation of {{Information field}}.

Template parameters

ParameterDescriptionDefaultStatus
1specifies whether it is the first, a medium or the last line of the table
bit 1 (0001) on: first line
bit 2 (0010) on (checked only when bit 1 is on): first line with header
bit 4 (0100) on: last line
bit 8 (1000) on (checked only when bit 1 is on): first line with field name
  • 00 (0000) medium line
  • 10 (0001) first line
  • 30 (0011) first line with header
  • 40 (0100) last line
  • 50 (0101) only line (1st and last = single line)
  • 70 (0111) only line with header
  • 90 (1001) first line with field name
  • D0 (1101) or
  • 13 (1101) single line with field name
 5 [1]required
2decimal color code for red, value 0 to 255 0 [1]required
3decimal color code for green, value 0 to 255 0 [1]required
4decimal color code for blue, value 0 to 255 0 [1]required
5descriptive color name (not HTML or PMS color name)
can as well be a translateable color name with e.g. {{I18n/red}} -
when the template exists; not for all 148 CSS color names !
emptyoptional
6Pantone name (if any) (like "9010 Pure White" or "9005 Jet Black")emptyoptional
textother header text than from the translation template I18n/Colorsemptyoptional
optionmore table header option parameters (see example 6)emptyoptional
stylemore table header style parametersemptyoptional
filename of a file to be displayed rightPAGENAMEoptional
sizedisplay size for that file48optional
descdescriptional textemptyoptional
pixeldisplay size for Easy border96optional

Additional information

The template is intended to be used in the following namespaces: all namespaces

The template is intended to be used by the following user groups: all users

Localization

To add your language to the list of languages supported by this template, please edit the template and add a row to the "{{LangSwitch|}}" construct. It takes the form "|xx= Your translation " (xx being the code of your language)

  1. a b c d (value when missing)

With Igen

To use it with the templates Image generation or ColorString, Igen/cbx uses Lua modules to convert the color codes from hex to dec.
Special values for Tbc-parameter 1 allow to separate table initiation (code B, and F for single line) and termination (code 6),
while all table rows are specified as "medium lines" (code 0). The default field name is always generated.


See the description at Template:Image generation#Tbc.


Examples:

1. One line

{{Tbc|5|186|31|181|violet|Purple}}
     violet rendered as RGB 186 031 181Pantone Purple
{{Tbc|7}}
Used color:
     rendered as RGB 000 000 000


2. Two lines

{{Tbc|1|0|115|54|green|356}}
{{Tbc|4|0|153|68|green|452-2x}}
     green rendered as RGB 000 115 054Pantone 356
     green rendered as RGB 000 153 068Pantone 452-2x
{{Tbc|3|237|41|35|red}}
{{Tbc|4|255|255|255|white}}
Used colors:
     red rendered as RGB 237 041 035
     white rendered as RGB 255 255 255


3. Three lines

{{Tbc|1|0|146|70|green|17-6153}}
{{Tbc|0|255|255|255|white|11-0601}}
{{Tbc|4|206|43|55|red|18-1662}}
     green rendered as RGB 000 146 070Pantone 17-6153
     white rendered as RGB 255 255 255Pantone 11-0601
     red rendered as RGB 206 043 055Pantone 18-1662
{{Tbc|3|232|125|13|<small>orange</small>|&nbsp;716
|text='''Colour''' values|file=Flag of Niger.svg|size=96|desc=3-colored flag}}
{{Tbc|0|0|146|70|<small>green</small>|17-6153}}
{{Tbc|4|255|255|255|white|11-0601}}
3-colored flag
Colour values
     orange rendered as RGB 232 125 013Pantone 00-716
     green rendered as RGB 000 146 070Pantone 17-6153
     white rendered as RGB 255 255 255Pantone 11-0601


4. with field name

{{Information
|description=description
|date=2013-01-24
|source={{Own}}
|author={{Ut|Example|Author name}}
|other versions=
|other fields={{Tbc|9|0|102|153|blue|text=Wikimedia colors<br>{{nobold|("websave colors)}
  |file=Wikitech logo-blank.svg|size=80|desc=WikiTech}} 
{{Tbc|0|255|255|255|white}} {{Tbc|0|0|153|102|green}} {{Tbc|4|153|0|0|red}}
}}
Description description
Date
Source Own work
Author Author name
Wikimedia colors
("websave" colors)
InfoField
WikiTech
     blue rendered as RGB 000 102 153
     white rendered as RGB 255 255 255
     green rendered as RGB 000 153 102
     red rendered as RGB 153 000 000


5. with Other fields and Template:Information field - and translateable color names

{{Information
|description=description
|date=2011-11-11
|source={{Own}}
|author={{Ut|Example|Author name}}
|other versions=
|other fields={{InFi|Gay colors|
{{Tbc|1|228|3|3|{{I18n/red}}}}
{{Tbc|0|255|140|0|{{I18n/orange}}}}
{{Tbc|0|255|237|0|{{I18n/yellow}}}}
{{Tbc|0|0|128|38|{{I18n/green}}}}
{{Tbc|0|0|77|255|{{I18n/blue}}}}
{{Tbc|4|117|7|135|{{I18n/purple}}}} }}
}}
Description description
Date
Source Own work
Author Author name
Gay colors
InfoField
     red rendered as RGB 228 003 003
     orange rendered as RGB 255 140 000
     yellow rendered as RGB 255 237 000
     green rendered as RGB 000 128 038
     blue rendered as RGB 000 077 255
     purple rendered as RGB 117 007 135


6. with an option

     purple rendered as RGB 204 000 204
     blue rendered as RGB 000 000 255
{{Tbc|1|204|0|204|purple|option=align=right}}
{{Tbc|4|0|0|255|blue}}


7. 2 examples: {{Tbc}} with {{ColorString}}

{{Information
|description=Wikimedia colors{{ColorString| /-/#069/wm blue/#096/wm green/#900/wm red}}
|other fields 1={{ColorString| /T/#FFFFFF/white}}
|date=2019-8-4 
|source={{Own}}
|author={{Ut|Example|Author name}}
|other fields={{Igen|U|+|cb=/T/LightSalmon//DarkTurquoise}}
}}
Specify instead of "cb=/T/..." the parameter "cb=e/T/..." for the option {{Easy border}}.
Description Wikimedia colors
  wm blue
  wm green
  wm red
Used color
InfoField
     white rendered as RGB 255 255 255
Date
Source Own work
Author Author name
Used colors
InfoField
     LightSalmon rendered as RGB 255 160 122
     DarkTurquoise rendered as RGB 000 206 209
TBC development
InfoField
 
This graphic was created with an unknown tool.


See also