"""
Macro for colorizing short text , usage is

{{{
[[Color(color, text)]]
}}}

"""
from StringIO import StringIO

def execute(hdf, args, env):
    buf = StringIO()
    if args:
        args = args.split(', ',1)
        buf.write("<font color='%(color)s'>%(text)s</font>" % dict(color=args[0], text=args[1]))
    else:
        buf.write("<p style='font-weight:bold; color:red;'>[[Color()]] macro requires a color spec and text: [[Color(color, text)]]</p>\n")

    return buf.getvalue()

