• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Hex2

  • Template
  • Talk
  • Language
  • Watch
  • Edit
Template documentation[view] [edit] [history] [purge]

Usage

edit

Converts an 8-bit number to hexadecimal using two digits, useful for formating RGB color components. This template can be substituted.

Input
  • one parameter, numeric in the range 0..255 (larger numbers will wrap around)
Output
  • a two-digit hex number

Examples

edit
  • {{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

See also

edit
  • {{Hex3}} for formating 3 RGB components at once.
The above documentation is transcluded from Template:Hex2/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Hex2&oldid=1177433255"
Last edited on 27 September 2023, at 15:35

Languages

    • تۆرکجه
    • Español
    • فارسی
    • Français
    • ગુજરાતી
    • 한국어
    • Bahasa Indonesia
    • Italiano
    • ქართული
    • മലയാളം
    • მარგალური
    • Bahasa Melayu
    • Мокшень
    • Nederlands
    • 日本語
    • Papiamentu
    • Português
    • Русский
    • Simple English
    • کوردی
    • Српски / srpski
    • Svenska
    • တႆး
    • Türkçe
    • Tiếng Việt
    • 中文
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 27 September 2023, at 15:35 (UTC).
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop