|
|
Line 4: |
Line 4: |
| <code style="font-style:normal"> {{{title|{{{4|{{{1}}}}}}}}} </code> | | <code style="font-style:normal"> {{{title|{{{4|{{{1}}}}}}}}} </code> |
| </div><noinclude> | | </div><noinclude> |
| {{documentation|content=
| |
| This template generates a color swatch box floating to the right margin.
| |
|
| |
| == Parameters ==
| |
|
| |
| # The color code in any notation supported by [[Cascading Style Sheets|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 ==
| |
|
| |
| === <nowiki>{{Swatch|Blue}}</nowiki> ===
| |
| {{Swatch|Blue}}
| |
| {{clear}}
| |
|
| |
| === <nowiki>{{Swatch|#FFFF00}}</nowiki> ===
| |
| {{Swatch|#FFFF00}}
| |
| {{clear}}
| |
|
| |
| === <nowiki>{{Swatch|rgb(20%, 40%, 60%)}}</nowiki> ===
| |
| {{Swatch|rgb(20%, 40%, 60%)}}
| |
| {{clear}}
| |
|
| |
| === <nowiki>{{Swatch|rgba(20%, 40%, 60%, 80%)}}</nowiki> ===
| |
| {{Swatch|rgba(20%, 40%, 60%, 80%)}}
| |
| {{clear}}
| |
|
| |
| === <nowiki>{{Swatch|rgb(20% 40% 60% / 80%)}}</nowiki> ===
| |
| {{Swatch|rgb(20% 40% 60% / 80%)}}
| |
| {{clear}}
| |
|
| |
| === <nowiki>{{Swatch|hsl(210deg, 40%, 60%)}}</nowiki> ===
| |
| {{Swatch|hsl(210deg, 40%, 60%)}}
| |
| {{clear}}
| |
|
| |
| === <nowiki>{{Swatch|hsl(3.66rad 40% 60%)}}</nowiki> ===
| |
| {{Swatch|hsl(3.66rad 40% 60%)}}
| |
| {{clear}}
| |
|
| |
| === <nowiki>{{Swatch|hsl(0.6turn 40% 60%)}}</nowiki> ===
| |
| {{Swatch|hsl(0.6turn 40% 60%)}}
| |
| {{clear}}
| |
|
| |
| === <nowiki>{{Swatch|hwb(210deg 40% 60%)}}</nowiki> ===
| |
| {{Swatch|hwb(210deg 40% 60%)}}
| |
| {{clear}}
| |
|
| |
| === <nowiki>{{Swatch|Lab(20% 0.4 0.6)}}</nowiki> ===
| |
| {{Swatch|Lab(20% 0.4 0.6)}}
| |
| {{clear}}
| |
|
| |
| === <nowiki>{{Swatch|Lch(40% 0.6 210deg)}}</nowiki> ===
| |
| {{Swatch|Lab(50% 0.8 210deg)}}
| |
| {{clear}}
| |
|
| |
| ==See also==
| |
|
| |
| * {{tl|color sample}} – small colored box: {{color sample|red}}
| |
| * {{tl|swatch inline}} – mostly for use on talk pages when discussing color: {{swatch inline|red}}
| |
| * {{tl|color swatch}} – similar to {{tl|swatch}} but with multiple parameters
| |
| * {{tl|coltit}} – colored table header cell
| |
| }}
| |
|
| |
| [[Category:Color templates]]
| |
| </noinclude>
| |