User:Csernica/Sandbox/Infobox Album/color


Important

edit

When modifying this template, don't forget to update Template:Infobox Album/link.

Usage

edit

This is an auxiliary template which should be only used by the {{Infobox Album}} template. The first parameter should be one of the codes from the table below, representing a type of album. The template returns the color that will be used.

Quick reference table

edit
CodeColor Display
studiolightsteelblue
Studio album by artist
demolightsteelblue
Demo album by artist
EP #F4BF92
EP by artist
single album #F4BF92
Single album by artist
liveburlywood
Live album by artist
greatest #BFE0BF
remix #BFE0BF
Remix album by artist
box #BFE0BF
Box set by artist
compilation #BFE0BF
mixtape #BFE0BF
Mixtape by artist
soundtrackgainsboro
filmgainsboro
Film score by artist
castgainsboro
Cast recording by artist
video #99CCFF
Video by artist
otherpeachpuff
other by artist

Unit test

edit

If at any time the Expected and Obtained columns do not match, this template can be considered broken. This table makes the template automatically check itself. If a  Y mark is seen, it means that self test worked fine. if there is a  N mark, it means the test failed. Whenever you make a modification to the template, please save the page, hit CTRL+F5, and check if all the self tests have passed. If you add a new type to the template, remember to add the type using this format:

| typename
| typecolor
| {{User:Csernica/Sandbox/Infobox Album/color|typename}}
| {{#ifeq:{{Template:User:Csernica/Sandbox/Infobox Album/color|typename}}|typecolor|{{y}}|{{n}}}}

Replace typename with the new type name (in example, Epic soundtrack), and typecolor with the color assigned to the type (in example, brown). See Wikipedia:Colours and Wikipedia:Infobox colours for additional information.

Note: Sometimes the test may pass while previewing the page, but once saved the test would fail, no matter how many times the cache is cleared. In this case, please click this link to purge the cache. If that doesn't solve the problem, please post a note in the Talk page of the template and an editor will review the changes.

Code Expected Obtained Test
Studio album
studio lightsteelblue lightsteelblue  Y
Studio album lightsteelblue lightsteelblue  Y
Double album lightsteelblue lightsteelblue  Y
[[Double album]] lightsteelblue lightsteelblue  Y
Demo album
demo lightsteelblue lightsteelblue  Y
EP
ep lightsalmon lightsalmon  Y
[[EP]] lightsalmon lightsalmon  Y
Live album
live burlywood burlywood  Y
Live album burlywood burlywood  Y
Greatest hits
greatest darkseagreen darkseagreen  Y
Greatest hits darkseagreen darkseagreen  Y
Remix album
remix darkseagreen darkseagreen  Y
Remix album darkseagreen darkseagreen  Y
Box set
box darkseagreen darkseagreen  Y
Box set darkseagreen darkseagreen  Y
Compilation album
compilation darkseagreen darkseagreen  Y
Compilation album darkseagreen darkseagreen  Y
Cover album
cover thistle thistle  Y
Cover album thistle thistle  Y
Tribute album
tribute thistle thistle  Y
Tribute album thistle thistle  Y
Soundtrack
soundtrack gainsboro gainsboro  Y
Television theme
television gainsboro gainsboro  Y
Television theme gainsboro gainsboro  Y
Film score
film gainsboro gainsboro  Y
Film score gainsboro gainsboro  Y
Video album
video #99CCFF #99CCFF  Y
Other cases
peachpuff peachpuff  Y
xyz peachpuff peachpuff  Y