Difference between revisions of "Template:Color"

From RimWorld Wiki
Jump to navigation Jump to search
(Template passes most existing tests. Support for disabling border not included. Line-breaking behaves weirdly around the template, but that may be an issue with the tests themselves. Work in progress.)
 
m (close span tag)
Line 28: Line 28:
  
 
Draw the square
 
Draw the square
--> <div style="width:{{{size|16px}}};height:{{{size|16px}}};background-color:rgba({{#var:red}},{{#var:green}},{{#var:blue}},{{#if:{{#var:alpha}}|{{#var:alpha}}|255}});display:inline-block;border:1px solid black;vertical-align:middle;"></div><span></includeonly><!-- FIXME: Add doc, remove sandbox --><noinclude>{{Template:Color/sandbox}}</noinclude>
+
--> <div style="width:{{{size|16px}}};height:{{{size|16px}}};background-color:rgba({{#var:red}},{{#var:green}},{{#var:blue}},{{#if:{{#var:alpha}}|{{#var:alpha}}|255}});display:inline-block;border:1px solid black;vertical-align:middle;"></div></span>
 +
</includeonly>
 +
<!-- FIXME: Add doc, remove sandbox -->
 +
<noinclude>{{Template:Color/sandbox}}</noinclude>

Revision as of 18:48, 8 August 2024

Rock

Bioferrite b.png

A cool rock I found.

Base Stats

Stuff Category
Rock
Stuff Color
(100, 80, 80)
Tech Level
Rock
Weapon Class
Rock

Simple tests

160,178,181

(160, 178, 181)


160, 178, 181

(160, 178, 181)


(160,178,181)

(160, 178, 181)


(160, 178, 181)

(160, 178, 181)


( 160, 178, 181 )

(160, 178, 181)


256, 256, 256: Shouldn't work


255, 255, 255: #FFFFFF; White


255, 0, 0: #FF0000; Red


0, 255, 0: #00FF00; Green


0, 0, 255: #0000FF; Blue


255, 255, 0: #FFFF00; Yellow


0, 255, 255: #00FFFF; Cyan


255, 0, 255: #FF00FF; Magenta


0, 0, 0: #000000; Black


Here is some text. It is in English.

Things made of plasteel will use the color

(160, 178, 181)

. This color is blue.

Lorem ipsum dolor sit amet.

Alpha

160,178,181,100

(160, 178, 181, 100)


160, 178, 181, 100

(160, 178, 181, 100)


(160,178,181,100)

(160, 178, 181, 100)


(160, 178, 181, 100)

(160, 178, 181, 100)


( 160, 178, 181 )

(160, 178, 181, 100)


Alternate usage

160|178|181

(160, 178, 181)


160|178|181|100

(160, 178, 181, 100)


Extra parameters

text=false


border=false

(160, 178, 181)


size=50px

(160, 178, 181)


Invalid input

red

(red, 255, 255)


#ffeeaa (

  1. ffeeaa, , )


700,700,700

(700, 700, 700)