1# -*- coding: utf-8 -*- 2""" 3 pygments.styles.rainbow_dash 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 6 A bright and colorful syntax highlighting `theme`. 7 8 .. _theme: http://sanssecours.github.io/Rainbow-Dash.tmbundle 9 10 :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. 11 :license: BSD, see LICENSE for details. 12""" 13 14from pygments.style import Style 15from pygments.token import (Comment, Error, Generic, Name, Number, Operator, 16 String, Text, Whitespace, Keyword) 17 18BLUE_LIGHT = '#0080ff' 19BLUE = '#2c5dcd' 20GREEN = '#00cc66' 21GREEN_LIGHT = '#ccffcc' 22GREEN_NEON = '#00cc00' 23GREY = '#aaaaaa' 24GREY_LIGHT = '#cbcbcb' 25GREY_DARK = '#4d4d4d' 26PURPLE = '#5918bb' 27RED = '#cc0000' 28RED_DARK = '#c5060b' 29RED_LIGHT = '#ffcccc' 30RED_BRIGHT = '#ff0000' 31WHITE = '#ffffff' 32TURQUOISE = '#318495' 33ORANGE = '#ff8000' 34 35 36class RainbowDashStyle(Style): 37 """ 38 A bright and colorful syntax highlighting theme. 39 """ 40 41 background_color = WHITE 42 43 styles = { 44 Comment: 'italic {}'.format(BLUE_LIGHT), 45 Comment.Preproc: 'noitalic', 46 Comment.Special: 'bold', 47 48 Error: 'bg:{} {}'.format(RED, WHITE), 49 50 Generic.Deleted: 'border:{} bg:{}'.format(RED_DARK, RED_LIGHT), 51 Generic.Emph: 'italic', 52 Generic.Error: RED_BRIGHT, 53 Generic.Heading: 'bold {}'.format(BLUE), 54 Generic.Inserted: 'border:{} bg:{}'.format(GREEN_NEON, GREEN_LIGHT), 55 Generic.Output: GREY, 56 Generic.Prompt: 'bold {}'.format(BLUE), 57 Generic.Strong: 'bold', 58 Generic.Subheading: 'bold {}'.format(BLUE), 59 Generic.Traceback: RED_DARK, 60 61 Keyword: 'bold {}'.format(BLUE), 62 Keyword.Pseudo: 'nobold', 63 Keyword.Type: PURPLE, 64 65 Name.Attribute: 'italic {}'.format(BLUE), 66 Name.Builtin: 'bold {}'.format(PURPLE), 67 Name.Class: 'underline', 68 Name.Constant: TURQUOISE, 69 Name.Decorator: 'bold {}'.format(ORANGE), 70 Name.Entity: 'bold {}'.format(PURPLE), 71 Name.Exception: 'bold {}'.format(PURPLE), 72 Name.Function: 'bold {}'.format(ORANGE), 73 Name.Tag: 'bold {}'.format(BLUE), 74 75 Number: 'bold {}'.format(PURPLE), 76 77 Operator: BLUE, 78 Operator.Word: 'bold', 79 80 String: GREEN, 81 String.Doc: 'italic', 82 String.Escape: 'bold {}'.format(RED_DARK), 83 String.Other: TURQUOISE, 84 String.Symbol: 'bold {}'.format(RED_DARK), 85 86 Text: GREY_DARK, 87 88 Whitespace: GREY_LIGHT 89 } 90