Jump to content

Template:Color/doc: Difference between revisions

From The Petit Planet Wiki
No edit summary
Updated
Line 1: Line 1:
{{Documentation/Header}}
{{Documentation/Header}}
{{Lua}}
{{Lua}}
{{CSS|Template:Color/styles}}
{{CSS|Template:Color/styles|Common}}
This '''Color''' template is used to add predefined formatted color to text. This uses the color classes in [[Template:Color/styles.css]]. If you want make additions or changes, please send suggestions to the [[Special:ListAdmins|Admins]].
Template that adds color to text.


==Syntax==
==Syntax==
There are two unnamed parameters that can be used. The first parameter declares the type of color (based on element or other identifier determined beforehand), and the second parameter is used to display the text.
<syntaxhighlight lang="wikitext" copy>
{{Color}}
</syntaxhighlight>
This template has 2 unnamed parameters:
* {{F|1}} &ndash; Color type, alias, or a valid color code.
* {{F|2}} &ndash; Text that will be colored.
* {{F|no_bold}} &ndash; Set to {{F|1}} to disable the auto bold.


If the second parameter is missing, the first parameter will be displayed.
===Colors===
 
{| class= "wikitable"
Use the '''link''' parameter to set a link for the text to link to. Set as ''1'' to use text as link.
 
{| class= "wikitable tdc3 tdc4 thc3 thc4"
! rowspan="2" | Type
! rowspan="2" | Type
! rowspan="2" | Aliases  
! rowspan="2" | Aliases  
Line 18: Line 21:
! Light Theme !! Dark Theme
! Light Theme !! Dark Theme
|-
|-
! colspan="4" | <center>Highlight Colors<center/>
| {{F|Accent}} ||  || <span style="color:#EAC863">'''#EAC863'''</span> || <span style="color:#DDBC5B">'''#DDBC5B'''</span>
|-
|-
| {{F|Buzz}} || {{F|Buzzword}}, {{F|Bz}} || <span style="color:#499AA1">'''#499AA1'''</span> || <span style="color:#54B2BA">'''#54B2BA'''</span>
| {{F|Buzz}} || {{F|Buzzword}}, {{F|Bz}} || <span style="color:#499AA1">'''#499AA1'''</span> || <span style="color:#54B2BA">'''#54B2BA'''</span>
Line 38: Line 41:


==Examples==
==Examples==
* {{T|Color|buzz|This text is colored as buzzwords|_Y_=1}}
===Default===
* {{T|Color|neighbor|This text is colored as highlighted words|_Y_=1}}
* {{T|Color|accent|This text is colored as accents.|_Y_=1}}
* {{T|Color|menu|This text is colored as menu titles|_Y_=1}}
* {{T|Color|buzz|This text is colored as buzzwords.|_Y_=1}}
* {{T|Color|new|This text is colored as new|_Y_=1}}
* {{T|Color|neighbor|This text is colored as highlighted words.|_Y_=1}}
* {{T|Color|old|This text is colored as old|_Y_=1}}
* {{T|Color|menu|This text is colored as menu titles.|_Y_=1}}
* {{T|Color|help|This text is colored as item highlight and help text|_Y_=1}}
* {{T|Color|new|This text is colored as new.|_Y_=1}}
* {{T|Color|catch|This text is colored as catch text|_Y_=1}}
* {{T|Color|old|This text is colored as old.|_Y_=1}}
* {{T|Color|whisper|This text is colored as whispers|_Y_=1}}
* {{T|Color|help|This text is colored as item highlight and help text.|_Y_=1}}
* {{T|Color|catch|This text is colored as catch text.|_Y_=1}}
* {{T|Color|whisper|This text is colored as whispers.|_Y_=1}}
* {{T|Color|#EA8A56|This text has custom color based on a Hex color code.|_Y_=1}}
 
===Additional===
* {{T|Color|neighbor|Mobai|no_bold=1|_Y_=1}}
* {{T|Color|Neighbor|[[Mobai]]|_Y_=1}}
 
==Template Data==
<templatedata>
{
"params": {
"1": {
"label": "Color",
"description": "Color type, alias, or a valid color code.",
"type": "string",
"required": true
},
"2": {
"label": "Text",
"description": "Text that will be colored.",
"type": "content",
"suggested": true
},
"no_bold": {
"label": "No bold",
"description": "Set to 1 to disable the auto bold.",
"type": "boolean"
}
},
"description": "Template that adds color to text.",
"format": "inline"
}
</templatedata>

Revision as of 10:42, 10 May 2026

This is the documentation page for Color.
It contains usage information, categories, and other content not part of the original template page.
This template uses Module:Color, a script written in Lua.
This template uses CSS found at Template:Color/styles.css and MediaWiki:Common.css.

Template that adds color to text.

Syntax

{{Color}}

This template has 2 unnamed parameters:

  • 1 – Color type, alias, or a valid color code.
  • 2 – Text that will be colored.
  • no_bold – Set to 1 to disable the auto bold.

Colors

Type Aliases Color
Light Theme Dark Theme
Accent #EAC863 #DDBC5B
Buzz Buzzword, Bz #499AA1 #54B2BA
Highlight Neighbor #80A132 #9DC43D
Menu #937C6E #D3BC8E
New Green #317E2A #41BE3A
Old Red #932015 #ED6D59
Help Tutorial, Item #BB8010 #E0BB00
Catch #17744B #85CDAE
Whisper wp #919175 #7C7F91

Examples

Default

  • {{Color|accent|This text is colored as accents.}} yields: This text is colored as accents.
  • {{Color|buzz|This text is colored as buzzwords.}} yields: This text is colored as buzzwords.
  • {{Color|neighbor|This text is colored as highlighted words.}} yields: This text is colored as highlighted words.
  • {{Color|menu|This text is colored as menu titles.}} yields: This text is colored as menu titles.
  • {{Color|new|This text is colored as new.}} yields: This text is colored as new.
  • {{Color|old|This text is colored as old.}} yields: This text is colored as old.
  • {{Color|help|This text is colored as item highlight and help text.}} yields: This text is colored as item highlight and help text.
  • {{Color|catch|This text is colored as catch text.}} yields: This text is colored as catch text.
  • {{Color|whisper|This text is colored as whispers.}} yields: This text is colored as whispers.
  • {{Color|#EA8A56|This text has custom color based on a Hex color code.}} yields: This text has custom color based on a Hex color code.

Additional

  • {{Color|neighbor|Mobai|no_bold = 1}} yields: Mobai
  • {{Color|Neighbor|[[Mobai]]}} yields: Mobai

Template Data

Template that adds color to text.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Color1

Color type, alias, or a valid color code.

Stringrequired
Text2

Text that will be colored.

Contentsuggested
No boldno_bold

Set to 1 to disable the auto bold.

Booleanoptional