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

Template:HexShade

  • Template
  • Talk
  • Language
  • Watch
  • Edit
Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:HexShade (sandbox)

This template takes an hex color code as first argument and a lightness between 0 and 1 as second argument, and returns a color with the same hue and saturation as the initial color but with its lightness overriden by the second argument.

Syntax
{{HexShade|Hex|L}}
To lighten the color to L
Hex is a 6-character hexadecimal color code (this template currently cannot handle 3-character), which can have a leading '#'
L is a number between 0 and 1 expressing the lightness
{{HexShade|Hex|L|#}}
Same as above, but automatically adds a leading #
Hex is a 6-character hexadecimal color code (this template currently cannot handle 3-character), which can have a leading '#'
L is a number between 0 and 1 expressing the lightness
Examples
Code Result

{{colorbox|#{{HexShade|FFEB00|0.0}}}}
{{colorbox|#{{HexShade|FFEB00|0.1}}}}
{{colorbox|#{{HexShade|FFEB00|0.2}}}}
{{colorbox|#{{HexShade|FFEB00|0.3}}}}
{{colorbox|#{{HexShade|FFEB00|0.4}}}}
{{colorbox|#{{HexShade|FFEB00|0.5}}}}
{{colorbox|#{{HexShade|FFEB00|0.6}}}}
{{colorbox|#{{HexShade|FFEB00|0.7}}}}
{{colorbox|#{{HexShade|FFEB00|0.8}}}}
{{colorbox|#{{HexShade|FFEB00|0.9}}}}
{{colorbox|#{{HexShade|FFEB00|1.0}}}}

 
 
 
 
 
 
 
 
 
 
 

{{colorbox|#{{HexShade|FFEB00}}}}
{{colorbox|{{HexShade|FFEB00||#}}}}
Color alone (does nothing)
 
{{colorbox|#{{HexShade|FFEB00|0.8}}}}
{{colorbox|{{HexShade|FFEB00|0.8|#}}}}
Color and lightness
 
{{colorbox|#{{HexShade|#FFEB00|0.8}}}}
{{colorbox|{{HexShade|#FFEB00|0.8|#}}}}
Color and lightness, with leading #
 
{{colorbox|#{{HexShade|{{party color|Independent Democratic Action}}|0.8}}}}
{{colorbox|{{HexShade|{{party color|Independent Democratic Action}}|0.8|#}}}}
Color and lightness, with leading # from {{party color}}
 
The above documentation is transcluded from Template:HexShade/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:HexShade&oldid=1060000686"
Last edited on 12 December 2021, at 22:38

Languages

    • Tiếng Việt
    • 中文
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 12 December 2021, at 22:38 (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