Color foreground and background of text
This 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.
[[Color(background-color, color, text)]]
Where 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.
[[Color(red, This has a red background)]] [[Color(lightblue, green, This has a lightblue background and green text)]] [[Color(none, #0000bb, I'm using a hex color)]]
which would then render as:This has a red background
Note: The effect of this macro could also be achieved out-of-the-box in Trac (>= 0.11.8) by span macro, see WikiHtml for details. Example usage of span macro:
[[span(''WORLD'', style=color: green)]]
If you have any issues, create a new ticket.
Download the zipped source from here.
- 15901 by rjollos on 2016-09-20 23:10:25
1.0: Add plugin metadata
- 14625 by diroussel on 2015-06-03 22:57:35
Added MIT license
- 11892 by rjollos on 2012-08-04 06:37:42
- Use Genshi to construct span element.
- Removed padding around span element.
- Format wiki to html, allowing wiki markup to be used as the text argument to the Color macro.