=====Color/ Colour Action Documentation===== This is the documentation page for the ##color##/##colour## action(s). >>**See also** [[http://wikkawiki.org/ColorAction | Development page]] >> ===Documentation=== {{since version="1.1.6.1" align="left"}} ==Short description== Renders a string as colored text. ==Usage:== ##""{{color [text="This is my text"] [fg="red"] [bg="black"]}}""## |?|Parameters|| |[| |=|name|=|type|=|required?|=|default|=|description|| |#| |=|text||string||mandatory||-||the text you want to display colored|| |=|bg||string||optional||-||{{since version="1.1.6.2" display="inline"}} color name or hex-value for the background|| |=|fg||string||optional||-||{{since version="1.1.6.2" display="inline"}} foreground color, alias for ##c##, introduced to fit with ##bg## || |=|c||string||optional||-||(html) color name or hex-value for the text|| |=|hex||string||optional||-||alias for ##c##, kept for backwards-compatibility;|| |?|Color names|| |=|{width:80px}name|=|{width:50px}color|| ||aqua||{background-color:aqua}|| ||black||{background-color:black}|| ||blue||{background-color:blue}|| ||fuchsia||{background-color:fuchsia}|| ||gray||{background-color:gray}|| ||green||{background-color:green}|| ||lime||{background-color:lime}|| ||maroon||{background-color:maroon}|| ||navy||{background-color:navy}|| ||olive||{background-color:olive}|| ||purple||{background-color:purple}|| ||red||{background-color:red}|| ||silver||{background-color:silver}|| ||teal||{background-color:teal}|| ||white||{background-color:white}|| ||yellow||{background-color:yellow}|| ==Long description== With ##""{{color}}""## action (or its alias ##""{{colour}}""##) you can specify text color using either one of HTML defined names or a hex value (with the former one taking priority). An optional background color can also be specified. Note that you must specify a text and either use "fg", "c" or "hex" for the color. ==Examples:== ##""{{color c="green" text="This is a test."}}""## {{color c="green" text="This is a test."}} If you want to use hex values: ##""{{color hex="#DD0000" text="This is another test."}}""## {{color hex="#DD0000" text="This is another test."}} Alternatively, you can specify a foreground and background color using the ##fg## and ##bg## parameters (they accept both named and hex values): ##""{{color fg="#FF0000" bg="#000000" text="This is colored text on colored background"}}""## {{color fg="#FF0000" bg="#000000" text="This is colored text on colored background"}} ##""{{color fg="yellow" bg="black" text="This is colored text on colored background"}}""## {{color fg="yellow" bg="black" text="This is colored text on colored background"}} ==Release Notes== - Versions **1.1.6.1** and below had support for parameters ##text##, ##c## and ##hex## only, and no check were performed about these values. - {{since version="1.1.6.2" display="inline"}} two new parameters ##bg## and ##fg## have been introduced, and the colors are checked for validity. RGB syntax, Hex syntax and a wide range of color names are supported. - {{since version="1.1.6.4" display="inline"}} support for a number of invalid colornames, such as ##antiquewhite##, ##lightgreen##, ... has been discontinued. Although these colornames are supported by almost every known browser, they do not validate against the CSS specification. Currently supported colornames are: ##aqua##, ##black##, ##blue##, ##fuchsia##, ##gray##, ##green##, ##lime##, ##maroon##, ##navy##, ##olive##, ##purple##, ##red##, ##silver##, ##teal##, ##white## and ##yellow##. ==Authors== - [[http://www.mornography.de/ | Hendrik Mans]] - [[http://wikkawiki.org/NilsLindenberg | Nils Lindenberg]] (modifications) - [[http://wikkawiki.org/DotMG | Mahefa Randimbisoa]] (modification - RGB syntax) ---- CategoryEN