wiki:ColorMacro

Color foreground and background of text

Description

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.

Usage:

[[Color( background-color, color , text )]] 

or:

[[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.

Note: This 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)]]

Bugs/Feature Requests

Existing bugs and feature requests for ColorMacro are here.

If you have any issues, create a new ticket.

defect

3 / 7

enhancement

4 / 4

task

1 / 2

Download

Download the zipped source from here.

Source

You can check out ColorMacro from here using Subversion, or browse the source with Trac.

Example

Example:

  [[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


This has a lightblue background and green text


I'm using a hex color

Recent Changes

14625 by diroussel on 2015-06-03 22:57:35
Added MIT license
11892 by rjollos on 2012-08-04 06:37:42

Fixes #1605, #5651,

  • 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.
11891 by rjollos on 2012-08-04 05:59:11
Renamed 0.12 directory to trunk. Deleted 0.11 directory.
(more)

Author/Contributors

Author: diroussel
Maintainer: David Roussel
Contributors:

Last modified 7 months ago Last modified on Nov 23, 2015, 2:45:36 PM