def __new__(mcs, name, bases, dct):
obj = type.__new__(mcs, name, bases, dct) for token in STANDARD_TYPES: if token notin obj.styles:
obj.styles[token] = ''
def colorformat(text): if text in ansicolors: return text if text[0:1] == '#':
col = text[1:] if len(col) == 6: return col elif len(col) == 3: return col[0] * 2 + col[1] * 2 + col[2] * 2 elif text == '': return'' elif text.startswith('var') or text.startswith('calc'): return text assertFalse, "wrong color format %r" % text
def style_for_token(cls, token):
t = cls._styles[token]
ansicolor = bgansicolor = None
color = t[0] if color in _deprecated_ansicolors:
color = _deprecated_ansicolors[color] if color in ansicolors:
ansicolor = color
color = _ansimap[color]
bgcolor = t[4] if bgcolor in _deprecated_ansicolors:
bgcolor = _deprecated_ansicolors[bgcolor] if bgcolor in ansicolors:
bgansicolor = bgcolor
bgcolor = _ansimap[bgcolor]
def styles_token(cls, ttype): return ttype in cls._styles
def __iter__(cls): for token in cls._styles: yield token, cls.style_for_token(token)
def __len__(cls): return len(cls._styles)
class Style(metaclass=StyleMeta):
#: overall background color (``None`` means transparent)
background_color = '#ffffff'
#: highlight background color
highlight_color = '#ffffcc'
#: line number font color
line_number_color = 'inherit'
#: line number background color
line_number_background_color = 'transparent'
#: special line number font color
line_number_special_color = '#000000'
#: special line number background color
line_number_special_background_color = '#ffffc0'
#: Style definitions for individual token types.
styles = {}
# Attribute for lexers defined within Pygments. If set # to True, the style is not shown in the style gallery # on the website. This is intended for language-specific # styles.
web_style_gallery_exclude = False
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.