模板:Hex2
用法
Converts an 8-bit number to hexadecimal using two digits, useful for formating RGB color components. This template can be substituted.
- 輸入
-
- one parameter, numeric in the range 0..255 (larger numbers will wrap around)
- 輸出
-
- a two-digit hex number
範例
{{Hex2|0}}
gives 00{{subst:Hex2|0}}
gives 00{{Hex2|123}}
gives 7B{{subst:Hex2|123}}
gives 7B{{Hex2|255}}
gives FF{{subst:Hex2|255}}
gives FF
參見
- {{Hex3}} for formating 3 RGB components at once.
上述文件嵌入自Template:Hex2/doc。 (編輯 | 歷史) 編者可以在本模板的沙盒 (建立 | 鏡像)和測試樣例 (建立)頁面進行實驗。 請在/doc子頁面中添加分類。本模板的子頁面。 |