2425:ace8a08028f3 | 2426:da76c71624de |
---|---|
3 pygments.style | 3 pygments.style |
4 ~~~~~~~~~~~~~~ | 4 ~~~~~~~~~~~~~~ |
5 | 5 |
6 Basic style object. | 6 Basic style object. |
7 | 7 |
8 :copyright: Copyright 2006-2012 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 | 11 |
12 from pygments.token import Token, STANDARD_TYPES | 12 from pygments.token import Token, STANDARD_TYPES |
13 | 13 |
24 if text[0:1] == '#': | 24 if text[0:1] == '#': |
25 col = text[1:] | 25 col = text[1:] |
26 if len(col) == 6: | 26 if len(col) == 6: |
27 return col | 27 return col |
28 elif len(col) == 3: | 28 elif len(col) == 3: |
29 return col[0]+'0'+col[1]+'0'+col[2]+'0' | 29 return col[0]*2 + col[1]*2 + col[2]*2 |
30 elif text == '': | 30 elif text == '': |
31 return '' | 31 return '' |
32 assert False, "wrong color format %r" % text | 32 assert False, "wrong color format %r" % text |
33 | 33 |
34 _styles = obj._styles = {} | 34 _styles = obj._styles = {} |