Color – Template
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Add Category:Templates and description) |
Lou Montana (talk | contribs) (Add error category) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><span style="color:{{{1 | <includeonly>{{#if:{{{1|}}} | ||
| <span class="template-colour" style="color:{{{1}}}">{{{2|-No text defined!-{{TemplateCase||[[Category:Color template usage error]]}}}}}</span> | |||
| {{{2|}}} {{TemplateCase||[[Category:Color template usage error]]}}[[:Category:Color template usage error|(no colour defined!)]] | |||
}}</includeonly><noinclude> | |||
Helps colouring text. | Helps colouring text. | ||
Line 14: | Line 17: | ||
* text: the text to be coloured | * text: the text to be coloured | ||
{|class="wikitable" | {| class="wikitable" | ||
|+ Examples | |+ Examples | ||
! Code | ! Code | ||
! Result | ! Result | ||
|- | |||
| <nowiki>{{Color}}</nowiki> | |||
| {{Color}} | |||
|- | |||
| <nowiki>{{Color|red}}</nowiki> | |||
| {{Color|red}} | |||
|- | |- | ||
| <nowiki>{{Color||Hello there!}}</nowiki> | | <nowiki>{{Color||Hello there!}}</nowiki> | ||
Line 28: | Line 37: | ||
| {{Color|#C33|General Kenobi!}} | | {{Color|#C33|General Kenobi!}} | ||
|- | |- | ||
| <nowiki>{{Color|darkorange|You are a bold one.}}</nowiki> | | <nowiki>{{Color|darkorange|You are a '''bold''' one.}}</nowiki> | ||
| {{Color|darkorange|You are a bold one.}} | | {{Color|darkorange|You are a '''bold''' one.}} | ||
|} | |} | ||
[[Category: Templates]] | [[Category: Templates]] | ||
</noinclude> | </noinclude> |
Latest revision as of 23:05, 1 November 2023
Helps colouring text.
Usage
{{Color|colour|text}}
- colour (Optional) CSS text 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)
- text: the text to be coloured
Code | Result |
---|---|
{{Color}} | (no colour defined!) |
{{Color|red}} | -No text defined!- |
{{Color||Hello there!}} | Hello there! (no colour defined!) |
{{Color|#33C|Hello there!}} | Hello there! |
{{Color|#C33|General Kenobi!}} | General Kenobi! |
{{Color|darkorange|You are a '''bold''' one.}} | You are a bold one. |