Template:HexShade
Appearance
This template uses Lua: |
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}}}} {{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}} |