Color – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Created page with "<span style="color:{{{1|}}}">{{{2|}}}</span>")
 
(Add Category:Templates and description)
Line 1: Line 1:
<span style="color:{{{1|}}}">{{{2|}}}</span>
<includeonly><span style="color:{{{1|inherit}}}">{{{2|}}}</span></includeonly><noinclude>
 
Helps colouring text.
 
== Usage ==
{{<nowiki/>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
 
{|class="wikitable"
|+ Examples
! Code
! Result
|-
| <nowiki>{{Color||Hello there!}}</nowiki>
| {{Color||Hello there!}}
|-
| <nowiki>{{Color|#33C|Hello there!}}</nowiki>
| {{Color|#33C|Hello there!}}
|-
| <nowiki>{{Color|#C33|General Kenobi!}}</nowiki>
| {{Color|#C33|General Kenobi!}}
|-
| <nowiki>{{Color|darkorange|You are a bold one.}}</nowiki>
| {{Color|darkorange|You are a bold one.}}
|}
 
[[Category: Templates]]
</noinclude>

Revision as of 18:45, 11 March 2020


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
Examples
Code Result
{{Color||Hello there!}} Hello there!
{{Color|#33C|Hello there!}} Hello there!
{{Color|#C33|General Kenobi!}} General Kenobi!
{{Color|darkorange|You are a bold one.}} You are a bold one.