From Brotato Wiki

(INITIAL \o/)
 
(Add support for "curse" color -- !!hotfix!!, need to change the hardcoded color style to a CSS class)
 
(7 intermediate revisions by the same user not shown)
Line 3: Line 3:
  | green  = <span style="color:rgb(0,255,0);">
  | green  = <span style="color:rgb(0,255,0);">
  | red    = <span style="color:rgb(244,0,0);">
  | red    = <span style="color:rgb(244,0,0);">
| pastelgreen = <span style="color:rgb(102 185 102);">
| pastelred  = <span style="color:rgb(191 89 89);">
| cream  = <span style="color:rgb(234,226,176);">
| grey
| gray    = <span style="color:gray">
  | tier1  = <span class="colorrarity1">
  | tier1  = <span class="colorrarity1">
  | tier2  = <span class="colorrarity2">
  | tier2  = <span class="colorrarity2">
  | tier3  = <span class="colorrarity3">
  | tier3  = <span class="colorrarity3">
  | tier4  = <span class="colorrarity4">
  | tier4  = <span class="colorrarity4">
| curse  = <span class="color-curse" style="color: #CA61FF;">
}}<!--
}}<!--
-->{{{text|{{{2|}}}}}}<!--
-->{{{text|{{{2|}}}}}}<!--
--></span></onlyinclude>
--></span></onlyinclude><noinclude>
<!-- The editor will show a syntax error above, but it *is* valid, the closing span just confuses the parser it off 👍 -->


<!-- NOTE: "{{{color|{{{1|}}}}}}" just lets you use either shortform or longhand -->
<noinclude>
Creates text with the specific color. Makes it possible to easily add/edit coloured text from the visual editor.
Creates text with the specific color. Makes it possible to easily add/edit coloured text from the visual editor.


The template uses a basic [https://en.wikipedia.org/wiki/Help:Conditional_expressions#switch switch], so it's easy to add new color options.
The template uses a basic [https://en.wikipedia.org/wiki/Help:Conditional_expressions#switch switch], so it's easy to add new color options.


{| class="wikitable"
==Examples==
 
{| class="wikitable" style="background: transparent; color: #eee;"
|+
|+
!Preview
!style="background-color: rgb(220,220,220,0.2); color: #eee;"| Preview
!Code (Shorthand)
!style="background-color: rgb(220,220,220,0.2); color: #eee;"| Code (Shorthand)
!Code (Longform)
!style="background-color: rgb(220,220,220,0.2); color: #eee;"| Code (Longform)
|-
|{{Color|green|Green (Positive Stat)}}
|<code><nowiki>{{Color|green|TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=green|text=TEXT}}</nowiki></code>
|-
|-
|{{Color|green|Green (Positive)}}
|{{Color|red|Red (Negative Stat)}}
|<code><nowiki>{{Color|green|YOUR_TEXT}}</nowiki></code>
|<code><nowiki>{{Color|red|TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=green|text=YOUR_TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=red|text=TEXT}}</nowiki></code>
|-
|-
|{{Color|red|Red (Negative)}}
|{{Color|pastelgreen|Pastel Green (Good Text)}}
|<code><nowiki>{{Color|red|YOUR_TEXT}}</nowiki></code>
|<code><nowiki>{{Color|pastelgreen|TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=red|text=YOUR_TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=pastelgreen|text=TEXT}}</nowiki></code>
|-
|{{Color|pastelred|Pastel Red (Bad Text)}}
|<code><nowiki>{{Color|pastelred|TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=pastelred|text=TEXT}}</nowiki></code>
|-
|{{Color|cream|Cream}}
|<code><nowiki>{{Color|cream|TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=cream|text=TEXT}}</nowiki></code>
|-
|{{Color|gray|Gray / Grey}}
|<code><nowiki>{{Color|gray|TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=grey|text=TEXT}}</nowiki></code>
|-
|-
|{{Color|tier1|Tier 1 (I)}}
|{{Color|tier1|Tier 1 (I)}}
|<code><nowiki>{{Color|tier1|YOUR_TEXT}}</nowiki></code>
|<code><nowiki>{{Color|tier1|TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=tier1|text=YOUR_TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=tier1|text=TEXT}}</nowiki></code>
|-
|-
|{{Color|tier2|Tier 2 (II)}}
|{{Color|tier2|Tier 2 (II)}}
|<code><nowiki>{{Color|tier2|YOUR_TEXT}}</nowiki></code>
|<code><nowiki>{{Color|tier2|TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=tier2|text=YOUR_TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=tier2|text=TEXT}}</nowiki></code>
|-
|-
|{{Color|tier3|Tier 3 (III)}}
|{{Color|tier3|Tier 3 (III)}}
|<code><nowiki>{{Color|tier3|YOUR_TEXT}}</nowiki></code>
|<code><nowiki>{{Color|tier3|TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=tier3|text=YOUR_TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=tier3|text=TEXT}}</nowiki></code>
|-
|-
|{{Color|tier4|Tier 4 (IV)}}
|{{Color|tier4|Tier 4 (IV)}}
|<code><nowiki>{{Color|tier4|YOUR_TEXT}}</nowiki></code>
|<code><nowiki>{{Color|tier4|TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=tier4|text=YOUR_TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=tier4|text=TEXT}}</nowiki></code>
|-
|{{Color|curse|Curse}}
|<code><nowiki>{{Color|curse|TEXT}}</nowiki></code>
|<code><nowiki>{{Color|color=curse|text=TEXT}}</nowiki></code>
|}
|}


Line 54: Line 80:
"color": {
"color": {
"label": "Color",
"label": "Color",
"description": "Supported: green, red, tier1, tier2, tier3, tier4",
"description": "Supported: green, red, cream, tier1, tier2, tier3, tier4, pastelgreen, pastelred, curse",
"type": "string",
"type": "string",
"autovalue": "green",
"autovalue": "green",
"required": true,
"required": true,
"suggested": true
"suggested": true,
"aliases": [
"1"
]
},
},
"text": {
"text": {
Line 64: Line 93:
"type": "string",
"type": "string",
"required": true,
"required": true,
"suggested": true
"suggested": true,
"aliases": [
"2"
]
}
}
},
},

Latest revision as of 18:16, 27 October 2024

Creates text with the specific color. Makes it possible to easily add/edit coloured text from the visual editor.

The template uses a basic switch, so it's easy to add new color options.

Examples

Preview Code (Shorthand) Code (Longform)
Green (Positive Stat) {{Color|green|TEXT}} {{Color|color=green|text=TEXT}}
Red (Negative Stat) {{Color|red|TEXT}} {{Color|color=red|text=TEXT}}
Pastel Green (Good Text) {{Color|pastelgreen|TEXT}} {{Color|color=pastelgreen|text=TEXT}}
Pastel Red (Bad Text) {{Color|pastelred|TEXT}} {{Color|color=pastelred|text=TEXT}}
Cream {{Color|cream|TEXT}} {{Color|color=cream|text=TEXT}}
Gray / Grey {{Color|gray|TEXT}} {{Color|color=grey|text=TEXT}}
Tier 1 (I) {{Color|tier1|TEXT}} {{Color|color=tier1|text=TEXT}}
Tier 2 (II) {{Color|tier2|TEXT}} {{Color|color=tier2|text=TEXT}}
Tier 3 (III) {{Color|tier3|TEXT}} {{Color|color=tier3|text=TEXT}}
Tier 4 (IV) {{Color|tier4|TEXT}} {{Color|color=tier4|text=TEXT}}
Curse {{Color|curse|TEXT}} {{Color|color=curse|text=TEXT}}

No description.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Colorcolor 1

Supported: green, red, cream, tier1, tier2, tier3, tier4, pastelgreen, pastelred, curse

Auto value
green
Stringrequired
Texttext 2

no description

Stringrequired