Toggle menu
15
236
70
27.5K
Kenshi Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 00:55, 25 February 2025 by Prd (talk | contribs) (Created page with "{{Documentation subpage}} <!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE --> == Usage == 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== * <code><nowiki>{{Hex2|0}}</nowiki></code>gives {{Hex2|0}} * <code><nowiki>{{subst:Hex2|0}}</nowiki></cod...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Usage

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

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

  • {{Hex3}} for formating 3 RGB components at once.