Template:Swatch
From Wikipedia, the free encyclopedia
{{{1}}}
Page Module:Documentation/styles.css has no content.
File:Test Template Info-Icon - Version (2).svg Template documentation
This template generates a color swatch box floating to the right margin.
Parameters
- The color code in any notation supported by CSS.
- Height of the swatch box, defaults to 100 pixels.
- Width of the swatch box, defaults to 162 pixels.
- or title: The caption of the color box, defaults to the color code.
Examples
{{Swatch|Blue}}
Blue
{{Swatch|#FFFF00}}
#FFFF00
{{Swatch|rgb(20%, 40%, 60%)}}
rgb(20%, 40%, 60%)
{{Swatch|rgba(20%, 40%, 60%, 80%)}}
rgba(20%, 40%, 60%, 80%)
{{Swatch|rgb(20% 40% 60% / 80%)}}
rgb(20% 40% 60% / 80%)
{{Swatch|hsl(210deg, 40%, 60%)}}
hsl(210deg, 40%, 60%)
{{Swatch|hsl(3.66rad 40% 60%)}}
hsl(3.66rad 40% 60%)
{{Swatch|hsl(0.6turn 40% 60%)}}
hsl(0.6turn 40% 60%)
{{Swatch|hwb(210deg 40% 60%)}}
hwb(210deg 40% 60%)
{{Swatch|Lab(20% 0.4 0.6)}}
Lab(20% 0.4 0.6)
{{Swatch|Lch(40% 0.6 210deg)}}
Lab(50% 0.8 210deg)
See also
- Template:Tl – small colored box: <span style="display:inline-block;border:1.62px solid black;vertical-align:text-top;" title="Lua error in package.lua at line 80: module 'Module:GetParameters' not found.">
- Template:Tl – mostly for use on talk pages when discussing color: red
- Template:Tl – similar to Template:Tl but with multiple parameters
- Template:Tl – colored table header cell