本模板用於統一各種元素週期表的配色及格式。
此模板返回元素的圖例十六進制色碼,用於HTML編碼,如:

  • {{Element color|Alkali metal}}#ff6666
  • 有些顏色作為字體前景色之用,如:
  • {{Element color|gas}}#cb0000
  • 有些返回值為完整的邊框設定,如:
  • {{Element color|Synthetic}}2px dotted #6e6e8e

駐:事實上真正返回的代碼類似 #ffc0c0; (# 為 "#"). 如此任何HTML頁面才不會將#視為編號用符號。

字體前景色選項

编辑
style=color attribute value
用法: style="color:{{element color|gas}};"

物質相態(前景色)

编辑
  • A  Solid → #000000 
  • A  Liquid → #007000 
  • A  Gas → #cb0000 
  • A  Unknown phase → #606060 

方格邊框選項

编辑
style=border attribute value
用法:style="border:{{element color|synthetic}};"

發現方法 (邊框)

编辑
  •    Primordial → 2px solid #6e6e8e 
  •    From decay → 2px dashed #6e6e8e Note: "Natural radio" deprecated
  •    Synthetic → 2px dotted #6e6e8e 
  •    Undiscovered → 2px solid transparent 
  •    None → 2px solid transparent 

背景色選項

编辑
style=background attribute value
用法: style="background:{{element color|alkali metals}};"

金屬–非金屬分類

编辑
  •    Alkali metals → #ff6666 
  •    Alkaline earth metals → #ffdead 
  •    Lanthanides → #ffbfff 
  •    Actinide → #ff99cc 
  •    Transition metal → #ffc0c0 
  •    Post-transition metal → #cccccc 
  •    Metalloid → #cccc99 
  •    Reactive nonmetal → #f0ff8f 
  •    Noble gas → #c0ffff 
  •    Unknown chemical properties → #e8e8e8 

Standard atomic weight

编辑
  •    saw-header → #b0e0e6 
  •    saw → #e1fcff 
  •    msi-header → #c3ffd8 
  •    msi → #e1ffec 
msi = most stable isotope

發現時期

编辑
  •    Antiquity to Middle Ages → #ffb9b9 
  •    Before 1800 → #dfcdff 
  •    1800-1849 → #cbffb9 
  •    1850-1899 → #b9ffe4 
  •    1900-1949 → #ffe2b9 
  •    1950-1999 → #fff6b9 
  •    2000-present → #ffb9ef 

例子: {{Periodic table (discovery periods)}}

Blocks

编辑
  •    s-block → #ff9999 
  •    p-block → #fdff8c 
  •    d-block → #99ccff 
  •    f-block → #9bff99 
  •    g-block → #fd99ff Note: unused, g-block does not exist. This color is used to derive the 'predicted' color

In period 8, theoretical elements:

  •    s-block (predicted) → #ffcccc 
  •    p-block (predicted) → #ffffbf 
  •    d-block (predicted) → #c7eeff 
  •    f-block (predicted) → #cdffcc 
  •    g-block (predicted) → #febfff 

Numbers

编辑

Used in: Valence (chemistry)#Maximum valences of the elements These colors correspond to the Alkali metal–noble gases range

  •    0 → #c0ffff 
  •    1 → #ff8989 
  •    2 → #ffdead 
  •    3 → #ffbfff 
  •    4 → #cccccc 
  •    5 → #cccc99 
  •    6 → #a0ffa0 
  •    7 → #ffff99 
  •    8 → #d1ddff 
  •    9 → #c6dd9d 
  •    unknown valence → #ededed 

Metalloid cite classes

编辑

See Template:Periodic table (list of metalloid lists)

  •    Metalloid citeclass 1of4 → #baffba Note: currently: 93%
  •    Metalloid citeclass 2of4 → #badcff Note: currently: 44%
  •    Metalloid citeclass 3of4 → #ffbadc Note: currently: 24%
  •    Metalloid citeclass 4of4 → #ffffba Note: currently: 9%

Setting a default color

编辑
|1=not a color name |default=#aabbcc → #aabbcc (use # not #)
|1=not a color name |default=thistle → thistle


"Unknown" variants

编辑

Usable in mainspace

  •    Unknown → #ffffff Note: Deprecated, too generic
  •    White → #ffffff 
  •    Unknown chemical properties → #e8e8e8  -- Category
  • A  Unknown phase → #606060  --SoM
  •    Undiscovered → 2px solid transparent Note: Border -- Occurrence
  •    none → 2px solid transparent Note: Border -- Occurrence

Wikipedia article quality

编辑

Used in: Wikipedia:WikiProject Elements/Articles/Periodic Table by Quality

  •    aq-FA → #6699ff 
  •    aq-A → #66ffff 
  •    aq-GA → #55cc55 Note: Formal color is #66ff66
  •    aq-B → #bcff66 Note: Formal color is #b2ff66
  •    aq-C → #ffff66 
  •    aq-Start → #ffaa66 
  •    aq-Stub → #ff6666 

Wikipedia article importance

编辑
  •    imp-Top → #ff00ff 
  •    imp-High → #ff88ff 
  •    imp-Mid → #ffbbff 
  •    imp-Low → #ffddff 
  •    imp-??? → #f8f9fa 
  •    imp-n/a → #f5f5f5 

Color names

编辑
  •    Black → #000000 
  •    White → #ffffff 
  •    blue → #0000ff 
  •    green → #008000 
  •    red → #ff0000 
  •    yellow → #ffff00 

Table background

编辑
  •    table title → #d8d8d8 
  •    table header → #e0e0e0 
  •    table colheader → #e8e8e8 
  •    table mark → #f0f0f0 
  •    table background → #f8f8f8 
  •    table border → #a9a9a9 

Template:Element color/table/overview

Colors hardcoded

编辑

The same colors, with the same key, may be hardcoded in templates and pages:


Template data

编辑
以下是该模板的模板数据,适用于可视化编辑器等工具。

Element color模板数据

This template returns an RGB color number, for usage in css style setting (style="background:#ab23a6"). For certain input, a css fontcolor or border style is returned.

模板参数

参数描述类型状态
Color class name1

Predefined class name to return its legend color

示例值
alkali metal
字符串必需

Deprecated and experimental parameters

编辑

Those not for mainspace are kept in {{Element color/secondary}}

See also

编辑