Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# encoding: utf-8
2from . import *
4def coloredText(
5 text="",
6 color="red",
7 htmlClass="",
8 pull=False,
9 size=False,
10 addBackgroundColor=False):
11 """
12 *Colour text a given colour*
14 **Key Arguments**
16 - ``text`` -- the text to color
17 - ``color`` -- the color
18 - ``htmlClass`` -- the class for the text
19 - ``size`` -- the relative size of the text
20 - ``addBackgroundColor`` -- add a complimentary background color to the text
23 **Return**
25 - ``text`` -- the coloured text span
27 """
28 if pull is not False:
29 pull = """pull-%(pull)s""" % locals()
30 else:
31 pull = ""
33 if size is not False:
34 size = """size-%(size)s""" % locals()
35 else:
36 size = ""
38 if addBackgroundColor is not False:
39 addBackgroundColor = "addBackground"
40 else:
41 addBackgroundColor = ""
43 text = """<span class="colortext %(color)s %(addBackgroundColor)s %(htmlClass)s %(pull)s %(size)s">%(text)s</span>""" % locals(
44 )
46 return text