Changes between Version 28 and Version 29 of ColorMacro


Ignore:
Timestamp:
Sep 21, 2016, 7:25:50 AM (8 years ago)
Author:
figaro
Comment:

Moved example to functional description

Legend:

Unmodified
Added
Removed
Modified
  • ColorMacro

    v28 v29  
    55== Description
    66
    7 This is a simple macro that allows you to change the background color of a piece of text. Useful for highlighting, or RAG (red, amber, green) status reports.
     7This is a macro that allows you to change the background color of a piece of text. This is useful for highlighting text that you want to draw attention to, or applying a RAG (red, amber, green) status to progress reports.
    88
    99Usage:
    1010{{{
    11 [[Color( background-color, color , text )]]
     11[[Color(background-color, color, text)]]
    1212}}}
    1313or:
    1414{{{
    15 [[Color( color , text )]]
     15[[Color(color, text)]]
    1616}}}
    1717
    1818Where '''color''' is a color keyword or hex color number recognised by your browser and '''text''' is your text. Commas are allowed, but '(' and ')' cause a problem.   
    1919
    20 '''Note''': This could also be achieved out-of-the-box in Trac (>=0.11.8) by span macro, see [t:WikiHtml#HowtoUseDivSpan WikiHtml] for details. Example usage of span macro:
     20Example:
     21{{{
     22  [[Color(red, This has a red background)]]
     23  [[Color(lightblue, green, This has a lightblue background and green text)]]
     24  [[Color(none, #0000bb, I'm using a hex color)]]
     25}}}
     26
     27which would then render as:
     28{{{#!html
     29<span style="background-color:red;padding: 0.1ex 0.4em;">This has a red background</span>
     30}}}
     31[[BR]]
     32{{{#!html
     33<span style="background-color:lightblue;color:green;padding: 0.1ex 0.4em;">This has a lightblue background and green text</span>
     34}}}
     35[[BR]]
     36{{{#!html
     37<span style="color:#0000bb;padding: 0.1ex 0.4em;">I'm using a hex color</span>
     38}}}
     39
     40'''Note''': The effect of this macro could also be achieved out-of-the-box in Trac (>= 0.11.8) by span macro, see [t:WikiHtml#HowtoUseDivSpan WikiHtml] for details. Example usage of span macro:
    2141{{{
    2242[[span(''WORLD'', style=color: green)]]
     
    4161You can check out ColorMacro from [/svn/colormacro here] using Subversion, or [source:colormacro browse the source] with Trac.
    4262
    43 == Example
    44 
    45 Example:
    46 {{{
    47   [[Color(red, This has a red background)]]
    48   [[Color(lightblue, green, This has a lightblue background and green text)]]
    49   [[Color(none, #0000bb, I'm using a hex color)]]
    50 }}}
    51 
    52 which would then render as:
    53 {{{#!html
    54 <span style="background-color:red;padding: 0.1ex 0.4em;">This has a red background</span>
    55 }}}
    56 [[BR]]
    57 {{{#!html
    58 <span style="background-color:lightblue;color:green;padding: 0.1ex 0.4em;">This has a lightblue background and green text</span>
    59 }}}
    60 [[BR]]
    61 {{{#!html
    62 <span style="color:#0000bb;padding: 0.1ex 0.4em;">I'm using a hex color</span>
    63 }}}
    64 
    6563== Recent Changes
    6664