Jump to content

Template:Color/doc: Difference between revisions

From The Petit Planet Wiki
the table is straight up wrong, but needed a doc somewhere.
ReisuDesign (talk | contribs)
No edit summary
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Documentation/Header}}
{{Documentation/Header}}
{{Lua}}
{{Lua}}
{{CSS|Template:Color/styles}}
{{CSS|Gadget-Color}}
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>
|-
|Buzzword || {{F|Bz}}, {{F|Buzz}} || colspan="2" | <span style="color:#FFAF2A">'''#FFAF2A'''</span>
|-
|-
|Highlight || {{F|h}} || <span style="color:#55771F">'''#55771F'''</span> || <span style="color:#A6EC34">'''#A6EC34'''</span>  
| {{F|Buzz}} || {{F|Buzzword}}, {{F|Bz}} || <span style="color:#499AA1">'''#499AA1'''</span> || <span style="color:#54B2BA">'''#54B2BA'''</span>
|-
|-
|Green || {{F|New}} || colspan="2" | <span style="color:#2BAD00">'''#2BAD00'''</span>  
| {{F|Highlight}} || {{F|Neighbor}} || <span style="color:#80A132">'''#80A132'''</span> || <span style="color:#9DC43D">'''#9DC43D'''</span>  
|-
|-
|Help || {{F|Tutorial}} || <span style="color:#BB8010">'''#BB8010'''</span> || <span style="color:#E0BB00">'''#E0BB00'''</span>  
| {{F|Menu}} ||  || <span style="color:#937C6E">'''#937C6E'''</span> || <span style="color:#D3BC8E">'''#D3BC8E'''</span>
|-
|-
|Menu || {{F|Action}} || <span style="color:#937C6E">'''#937C6E'''</span> || <span style="color:#D3BC8E">'''#D3BC8E'''</span>  
| {{F|New}} || {{F|Green}} || <span style="color:#317E2A">'''#317E2A'''</span> || <span style="color:#41BE3A">'''#41BE3A'''</span>
|-
|-
|Red || {{F|Old}} || colspan="2" | <span style="color:#CF4029">'''#CF4029'''</span>  
| {{F|Old}} || {{F|Red}} || <span style="color:#932015">'''#932015'''</span> || <span style="color:#ED6D59">'''#ED6D59'''</span>
|-
|-
|Whisper || {{F|wp}} || colspan="2" | <span style="color:#CF4029">'''#B5B5B5'''</span>  
| {{F|Help}} || {{F|Tutorial}}, {{F|Item}} || <span style="color:#BB8010">'''#BB8010'''</span> || <span style="color:#E0BB00">'''#E0BB00'''</span>
|-
|-
! colspan="4" | <center>Attribute Colors<center/>
| {{F|Catch}} ||  || <span style="color:#17744B">'''#17744B'''</span> || <span style="color:#85CDAE">'''#85CDAE'''</span>
|-
|-
|Electric || {{F|shock}}, {{F|zap}} || colspan="2" | <span style="color:#33B6FE">'''#33B6FE'''</span>
| {{F|Whisper}} || {{F|wp}} || <span style="color:#919175">'''#919175'''</span> || <span style="color:#7C7F91">'''#7C7F91'''</span>  
|-
|Ether || {{F|corrupted}}, {{F|corruption}}, {{F|auric ink}} || colspan="2" | <span style="color:#FE427E">'''#FE427E'''</span>
|-
|Fire|| {{F|Burn}}, {{F|Blaze}} || colspan="2" |  <span style="color:#FF5623">'''#FF5623'''</span>
|-
|Ice || {{F|Freeze}}, {{F|Freezing}}, {{F|frost}}, {{F|Frostbite}}, {{F|Frostburn}}, {{F|Frozen}}, {{F|Shatter}},  || <span style="color:#1DAFAD">'''#1DAFAD'''</span> || <span style="color:#95EAE9">'''#95EAE9'''</span>
|-
|Physical || {{F|Assault}}, {{F|Flinch}} || <span style="color:#C2A30A">'''#C2A30A'''</span> || <span style="color:#EDCC2C">'''#EDCC2C'''</span>
|-
|Wind || || <span style="color:#0AC272">'''#0AC272'''</span> || <span style="color:#4BEEA7">'''#4BEEA7'''</span>
|-
! colspan="4" | <center>Other Text Colors<center/>
|-
|Fairy|| || <span style="color:#06B4E0">'''#06B4E0'''</span> || <span style="color:#56D6F6">'''#56D6F6'''</span>  
|-
|Hacked || || colspan="2" | <span style="color:#C0232A">'''#C0232A'''</span>
|}
|}


==Examples==
==Examples==
* {{T|Color|Buzzword|This text is colored as quest buzzwords|_Y_=1}}
===Default===
* {{T|Color|menu|This text is colored as menu titles|_Y_=1}}
* {{T|Color|accent|This text is colored as accents.|_Y_=1}}
* {{T|Color|highlight|This text is colored as highlighted|_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 has the tutorial help text|_Y_=1}}
* {{T|Color|new|This text is colored as new.|_Y_=1}}
* {{T|Color|whisper|This text is colored as whispers|_Y_=1}}
* {{T|Color|old|This text is colored as old.|_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|common|This text is colored as common.|_Y_=1}}
* {{T|Color|uncommon|This text is colored as uncommon.|_Y_=1}}
* {{T|Color|rare|This text is colored as rare.|_Y_=1}}
* {{T|Color|stellar|This text is colored as stellar.|_Y_=1}}
* {{T|Color|miracle|This text is colored as miracle.|_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>

Latest revision as of 05:07, 20 September 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 MediaWiki:Gadget-Color.css.

Template that adds color to text.

Syntax

[edit source]
{{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

[edit source]
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

[edit source]

Default

[edit source]
  • {{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|common|This text is colored as common.}} yields: This text is colored as common.
  • {{Color|uncommon|This text is colored as uncommon.}} yields: This text is colored as uncommon.
  • {{Color|rare|This text is colored as rare.}} yields: This text is colored as rare.
  • {{Color|stellar|This text is colored as stellar.}} yields: This text is colored as stellar.
  • {{Color|miracle|This text is colored as miracle.}} yields: This text is colored as miracle.
  • {{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

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

Template Data

[edit source]

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