Difference between revisions of "Template:Color"

From Nookipedia, the Animal Crossing wiki
(Adding display parameter to adjust div arrangement)
m
 
(28 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
<div style="background:{{#switch:{{{1|}}}
 
<div style="background:{{#switch:{{{1|}}}
 
| red
 
| red
| Red = #ff9999
+
| Red = #ffaa9a
 
| green
 
| green
| Green = #adebad
+
| Green = #84daa1
 
| blue
 
| blue
| Blue = #9999ff
+
| Blue = #90cbde
 
| yellow
 
| yellow
| Yellow = #ffeb99
+
| Yellow = #ffe19b
 
| orange
 
| orange
| Orange = #ffc299
+
| Orange = #ffce9b
 
| pink
 
| pink
| Pink = #fab4e6
+
| Pink = #ffc9c0
 
| purple
 
| purple
| Purple = #cc99ff
+
| Purple = #d6a1ba
 
| aqua
 
| aqua
 
| Aqua
 
| Aqua
Line 38: Line 38:
 
| Black = #b3b3b3
 
| Black = #b3b3b3
 
| colorful
 
| colorful
| Colorful = linear-gradient(to right, #ff9999,#adebad 40%, #adebad, #adebad 60%, #9999ff)
+
| Colorful = linear-gradient(to right, #ff9999,#adebad {{#if:{{{small|}}}|50|40}}%, #adebad, #adebad {{#if:{{{small|}}}|50|60}}%, #9999ff)
| #default= #e6e6e6
+
| #default= {{{1|#e6e6e6}}}
}}; {{roundy|{{{roundy|9px}}}}}; {{#if:{{{height|}}}|line-height:{{{height|}}};}} {{#if:{{{display|}}}|display:{{{display|}}};}} text-align:center; padding:4px 3px 4px 3px; margin:3px; width:{{{width|4.5em}}};"><small>{{{1|Unknown}}}</small></div><noinclude>
+
}}; {{roundy|{{{roundy|9px}}}}} {{#if:{{{display|}}}|display:{{{display|inline-block}}};}} text-align:center; padding:3px; margin:{{{margin|3px}}}{{#if:{{{center|}}}|<nowiki> </nowiki>auto}}; {{#switch:{{{1|}}}|white|White= border:1px solid #ccc;}} {{#if:{{{center|}}}|margin: 1 auto;}} {{#if:{{{small|}}}|width:{{{width|5px}}}; line-height:{{{height|5px}}}; display:inline-block;">&nbsp;</div><div style="display:inline-block;">{{#if:{{{text|}}}|{{{text|}}}|<small>{{{1|N/A}}}</small>}}</div>| width:{{{width|4.5em}}}; {{#if:{{{height|}}}|line-height:{{{height|}}};}}">{{#switch:{{{link|}}}| Yes =
 
+
{{#switch:{{{1|}}}
==Usage==
+
| Red      = <small>[[List of red furniture items|<span style="color:black">Red</span>]]</small>
 
+
| Orange    = <small>[[List of orange furniture items|<span style="color:black">Orange</span>]]</small>
<pre>
+
| Yellow    = <small>[[List of yellow furniture items|<span style="color:black">Yellow</span>]]</small>
{{Color|<color>|height=<optional>|width=<optional>|display=<optional>|roundy=<optional>}}
+
| Green    = <small>[[List of green furniture items|<span style="color:black">Green</span>]]</small>
</pre>
+
| Aqua      = <small>[[List of aqua furniture items|<span style="color:black">Aqua</span>]]</small>
Creates a div with a background of a given color, with a color name centered inside. If no value is entered, default color is used and box displays 'Unknown'.
+
| Blue      = <small>[[List of blue furniture items|<span style="color:black">Blue</span>]]</small>
 
+
| Purple    = <small>[[List of purple furniture items|<span style="color:black">Purple</span>]]</small>
{| style="border-collapse:collapse;"
+
| Pink      = <small>[[List of pink furniture items|<span style="color:black">Pink</span>]]</small>
!colspan=4 style="text-align:left;"|&nbsp;Supported Colors
+
| Beige    = <small>[[List of beige furniture items|<span style="color:black">Beige</span>]]</small>
|-
+
| Brown    = <small>[[List of brown furniture items|<span style="color:black">Brown</span>]]</small>
|{{Color|Red}}
+
| Gray      = <small>[[List of gray furniture items|<span style="color:black">Gray</span>]]</small>
{{Color|Green}}
+
| White    = <small>[[List of white furniture items|<span style="color:black">White</span>]]</small>
{{Color|Blue}}
+
| Black    = <small>[[List of black furniture items|<span style="color:black">Black</span>]]</small>
{{Color|Yellow}}
+
| Colorful  = <small>[[List of colorful furniture items|<span style="color:black">Colorful</span>]]</small>
|{{Color|Orange}}
+
}}|#default = {{#if:{{{text|}}}|{{{text|}}}|<small>{{{1|N/A}}}</small>}}}}</div>}}
{{Color|Pink}}
+
<noinclude>{{Documentation}}</noinclude>
{{Color|Purple}}
 
{{Color|L. Blue}}
 
|{{Color|Beige}}
 
{{Color|Brown}}
 
{{Color|Gray}}
 
{{Color|White}}
 
|style="vertical-align:bottom;"|{{Color|Colorful}}
 
{{Color|Black}}
 
{{Color|Default}}
 
|}
 

Latest revision as of 23:49, October 2, 2022

N/A

Template documentation (view)


Emotion Surprise NH Icon cropped.png
This template is complex or is transcluded on a large number of pages.
Due to the sensitive nature of this template, caution is advised before editing. Any changes should first be tested in a sandbox. Please consider discussing planned changes on the talk page or with staff members before implementing them.
Emotion Surprise NH Icon cropped.png
This template is complex or is transcluded on a large number of pages.
Due to the sensitive nature of this template, caution is advised before editing. Any changes should first be tested in a sandbox. Please consider discussing planned changes on the talk page or with staff members before implementing them.

Usage

{{Color|<color>|height=<optional>|width=<optional>|margin=<optional>|display=<optional>|roundy=<optional>|small=<optional>|center=<optional>}}

This template creates a div with a background of a given color, with the name of the color centered inside. If no value is entered, a default color is used and box displays 'N/A'. Setting any value for the small parameter will result in the colored box being placed to the left of the text rather than enveloping it.

 Supported Colors
Red
Green
Blue
Yellow
Orange
Pink
Purple
L. Blue
Beige
Brown
Gray
White
Colorful
Black
Default

Example

{{Color|Red|width=100px}}
Red
{{Color|Red|small=yes}}
 
Red