模板:Color box

出自Terraria Wiki
跳至導覽 跳至搜尋

此模板使用了 Lua。
此模板使用了用 Lua 編程語言編寫的 模塊:Color。要了解 Lua 的更多信息,參見 en:Terraria Wiki:Lua
Template-info.svg 文檔 以下文檔來自Template:Color box/doc。(編輯 | 歷史

Produces a simple colored box.

Usage

{{ color box | <color> | border = <color> | width = <box width> | height = <box height> | size = <box size> | text = y/yes | textformat = hex/rgb}}

First unnamed parameter

Sets the background color of the box. Can be any valid CSS color.

border (optional)

Sets the color of the border around the box. Defaults to text color.

size/width/height (optional)

Size will override the width/height parameter. Width and height default to 1.25em.

text (optional)

Appends the color value from the first unnamed parameter.

textformat (optional)

Forces a specific format of the color text: hexadecimal or RGB. Has no effect if $text is not true. The color value from the first unnamed parameter must be a valid hexadecimal or RGB value (and will be converted according to this parameter, if necessary), otherwise no text will be displayed at all. For instance, orange as the first unnamed parameter will not work with this parameter.

Examples

Code Output
{{color box|#FF00FF}}
{{color box|orange}}
{{color box|orange|text=y}}  orange
{{color box|#FF0000|width=40px}}
{{color box|#FF0000|height=40px}}
{{color box|#FF0000|size=40px}}
{{color box|#FF0000|size=40px|width=1000px}}
{{color box|#FF0000|size=40px|text=y}}  #FF0000
{{color box|rgb(9, 61, 191)|text=y}}  rgb(9, 61, 191)
{{color box|rgb(9, 61, 191)|text=y|textformat=hex}}  #093DBF
{{color box|#093DBF|text=y|textformat=rgb}}  rgb(9, 61, 191)
{{color box|RgB( 9, 61   ,191)|text=y|textformat=rgb}}  rgb(9, 61, 191)