Colorball – Template
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Add 3D effect) |
Lou Montana (talk | contribs) m (Text replacement - "{|class" to "{| class") |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><div style="background-color: {{{1|#025D00}}}; background: radial-gradient(circle at 0.25em 0.25em, #FFF, {{{1|#025D00}}}, #333); border-radius: 50%; box-shadow: 0 0 3px 0 #888; display: inline-block; font-size: {{{2|1}}}em;vertical-align: middle; height: 1em; width: 1em"></div></includeonly><noinclude> | <includeonly><div style="background-color: {{{1|#025D00}}}; background: radial-gradient(circle at 0.25em 0.25em, #FFF, {{{1|#025D00}}}, #333); border-radius: 50%; box-shadow: 0 0 3px 0 #888; display: inline-block; font-size: {{{2|1}}}em; margin: 3px; vertical-align: middle; height: 1em; width: 1em"></div></includeonly><noinclude> | ||
Displays a color ball. | Displays a color ball. | ||
== Usage == | == Usage == | ||
<nowiki>{{ | <nowiki>{{Colorball|</nowiki>'''''colour'''''|'''''size'''''}} | ||
* color: (Optional, default #025D00) HTML colour, can be one of: | * color: (Optional, default #025D00) HTML colour, can be one of: | ||
** HTML colour name - ''red'', ''darkgrey'', etc. | ** HTML colour name - ''red'', ''darkgrey'', etc. | ||
** HTML colour format - '''#RRGGBB''' | ** HTML colour format - '''#RGB''' or '''#RRGGBB''' | ||
** rgb format - '''rgb(255, 0, 0)''' | ** rgb format - '''rgb(255, 0, 0)''' | ||
** rgba format - '''rgba(255, 0, 0, 0.5)''' | ** rgba format - '''rgba(255, 0, 0, 0.5)''' | ||
Line 13: | Line 13: | ||
* size (Optional, default 1) size relative to font-size (em) | * size (Optional, default 1) size relative to font-size (em) | ||
{|class="wikitable" | {| class="wikitable" | ||
|+ Examples | |+ Examples | ||
! Code | ! Code | ||
! Result | ! Result | ||
|- | |- | ||
| <nowiki>{{ | | <nowiki>{{Colorball}}</nowiki> | ||
| {{ | | {{Colorball}} | ||
|- | |- | ||
| <nowiki>{{ | | <nowiki>{{Colorball|orange}}</nowiki> | ||
| {{ | | {{Colorball|orange}} | ||
|- | |- | ||
| <nowiki>{{ | | <nowiki>{{Colorball|#FF5533|2}}</nowiki> | ||
| {{ | | {{Colorball|#FF5533|2}} | ||
|- | |- | ||
| <nowiki>{{Colorball|#F0F|8}}</nowiki> | |||
| {{Colorball|#F0F|8}} | |||
|} | |} | ||
Line 32: | Line 34: | ||
<syntaxhighlight lang="html"> | <syntaxhighlight lang="html"> | ||
<div style=" | <div style=" | ||
background-color: | background-color: {{{1|#025D00}}}; | ||
background: radial-gradient(circle at 0.25em 0.25em, #FFF, | background: radial-gradient(circle at 0.25em 0.25em, #FFF, {{{1|#025D00}}}, #333); | ||
border-radius: 50%; | border-radius: 50%; | ||
box-shadow: 0 0 3px 0 #888; | box-shadow: 0 0 3px 0 #888; | ||
display: inline-block; | display: inline-block; | ||
font-size: | font-size: {{{2|1}}}em; | ||
margin: 3px; | |||
vertical-align: middle; | vertical-align: middle; | ||
height: 1em; | height: 1em; | ||
Line 43: | Line 46: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Templates|{{uc: | [[Category:Templates|{{uc:{{PAGENAME}}}}]] | ||
</noinclude> | </noinclude> |
Latest revision as of 13:51, 10 August 2021
Displays a color ball.
Usage
{{Colorball|colour|size}}
- color: (Optional, default #025D00) HTML colour, can be one of:
- HTML colour name - red, darkgrey, etc.
- HTML colour format - #RGB or #RRGGBB
- rgb format - rgb(255, 0, 0)
- rgba format - rgba(255, 0, 0, 0.5)
- hsl format - hsl(120, 100%, 50%)
- hsla format - hsla(120, 60%, 70%, 0.3)
- size (Optional, default 1) size relative to font-size (em)
Code | Result |
---|---|
{{Colorball}} | |
{{Colorball|orange}} | |
{{Colorball|#FF5533|2}} | |
{{Colorball|#F0F|8}} |
Source
<div style="
background-color: {{{1|#025D00}}};
background: radial-gradient(circle at 0.25em 0.25em, #FFF, {{{1|#025D00}}}, #333);
border-radius: 50%;
box-shadow: 0 0 3px 0 #888;
display: inline-block;
font-size: {{{2|1}}}em;
margin: 3px;
vertical-align: middle;
height: 1em;
width: 1em"></div>