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

Template:Hex3

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

Usage

edit

Converts three 8-bit numbers to hexadecimal. Useful for all sorts of color-related nefarious purposes. This template can be substituted.

Input
  • three parameters, each numeric in the range 0..255 (larger numbers will wrap around)
  • #= (optional) allows you to change or remove the prefix for hex numbers (such as #) ; the default prefix is " #" (with a leading space to avoid the internal interpretation by MediaWiki as a numbered list item when returning the value from the template; this space does not alter the CSS validity of the value).
Output
  • a triplet of two-digit hex numbers

Examples

edit
  • {{Hex3|0|0|0}}gives #000000
  • {{subst:Hex3|0|0|0}} gives #000000
  • {{Hex3|123|45|67}} gives #7B2D43
  • {{subst:Hex3|123|45|67}}gives #7B2D43
  • {{Hex3|255|255|255}} gives #FFFFFF
  • {{subst:Hex3|255|255|255}} gives #FFFFFF

See also

edit
  • {{RGB}} for formating as a "rgb(r,g,b)" value
  • {{Hex2}} if you don't want three all at once.
The above documentation is transcluded from Template:Hex3/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:Hex3&oldid=1177434138"
Last edited on 27 September 2023, at 15:39

Languages

    • تۆرکجه
    • Dolnoserbski
    • Español
    • فارسی
    • Galego
    • ગુજરાતી
    • 한국어
    • Hornjoserbsce
    • Bahasa Indonesia
    • Italiano
    • ქართული
    • മലയാളം
    • მარგალური
    • Bahasa Melayu
    • 日本語
    • Português
    • Русский
    • Simple English
    • کوردی
    • Српски / srpski
    • Svenska
    • Татарча / tatarça
    • တႆး
    • Türkçe
    • Tiếng Việt
    • 中文
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 27 September 2023, at 15:39 (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