Difference between revisions of "Template:Hex2/doc"
Jump to navigation
Jump to search
imported>Verdy p m |
imported>Borgx m (+id) |
||
| Line 26: | Line 26: | ||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> | <!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> | ||
[[Category:Color conversion templates|Hex3]] | [[Category:Color conversion templates|Hex3]] | ||
| − | + | [[id:Templat:Hex2]] | |
</includeonly> | </includeonly> | ||
Revision as of 15:16, 29 May 2009
| This is a documentation subpage for Template:Hex2. It contains usage information, categories and other content that is not part of the original template page. |
- Description of use
- Converts a 8-bit number to hexadecimal using two digits.
- Useful for formating RGB color components.
- Input
-
- a parameter, numeric in the range 0..255 (larger numbers will wrap around)
- subst=subst: (optional) allows to perform a permanent substitution of the internal sub-expressions (or subtemplates that may be used), and keep only the result of the evaluations when saving a page using this template. You should pass this parameter in addition to calling the template using the "subst:" prefix that just performs a permanent template expansion and permanent substitution of parameters. (See examples below).
- Output
-
- a two-digit hex number
- Examples
-
- {{Hex2|0}}gives 00
- {{subst:Hex2|0|subst=subst:}} gives 00
- {{Hex2|123}} gives 7B
- {{subst:Hex2|123|subst=subst:}}gives 7B
- {{Hex2|255}} gives FF
- {{subst:Hex2|255|subst=subst:}} gives FF
- See also
-
- {{Hex3}} for formating 3 RGB components at once.