6 Basic style object. |
6 Basic style object. |
7 |
7 |
8 :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. |
8 :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. |
9 :license: BSD, see LICENSE for details. |
9 :license: BSD, see LICENSE for details. |
10 """ |
10 """ |
11 |
|
12 from __future__ import unicode_literals # __IGNORE_WARNING__ |
|
13 |
11 |
14 from pygments.token import Token, STANDARD_TYPES |
12 from pygments.token import Token, STANDARD_TYPES |
15 |
13 |
16 def with_metaclass(meta, base=object): |
14 def with_metaclass(meta, base=object): |
17 """ |
15 """ |
20 """ |
18 """ |
21 return meta("NewBase", (base,), {}) |
19 return meta("NewBase", (base,), {}) |
22 |
20 |
23 |
21 |
24 class StyleMeta(type): |
22 class StyleMeta(type): |
|
23 background_color = '#ffffff' |
|
24 |
|
25 #: highlight background color |
|
26 highlight_color = '#ffffcc' |
|
27 |
|
28 #: Style definitions for individual token types. |
|
29 styles = {} |
25 |
30 |
26 def __new__(mcs, name, bases, dct): |
31 def __new__(mcs, name, bases, dct): |
27 obj = type.__new__(mcs, name, bases, dct) |
32 obj = type.__new__(mcs, name, bases, dct) |
28 for token in STANDARD_TYPES: |
33 for token in STANDARD_TYPES: |
29 if token not in obj.styles: |
34 if token not in obj.styles: |