Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Swatch: Difference between revisions

Template page
Created page with "<div class="floatright" style="text-align: center;"> <div style="background-color: {{{1}}}; height: {{{2|100px}}}; width: {{{3|162px}}}; border: 1px solid" title="{{{4|{{{1}}}..."
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div class="floatright" style="text-align: center;">
<div style="text-align: center;">
<div style="background-color: {{{1}}}; height: {{{2|100px}}}; width: {{{3|162px}}}; border: 1px solid" title="{{{4|{{{1}}}}}}">
<div style="background-color: {{{1}}}; height: {{{2|50px}}}; width: {{{3|50px}}}; border: 0px solid" title="{{{4|{{{1}}}}}}">
&nbsp;</div>
&nbsp;</div>
<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>

Latest revision as of 19:33, 15 September 2020

 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.