codekingpro/portable-devtools
114k
1"""2 pygments.styles.solarized3 ~~~~~~~~~~~~~~~~~~~~~~~~~4 5 Solarized by Camil Staps6 7 A Pygments style for the Solarized themes (licensed under MIT).8 See: https://github.com/altercation/solarized9 10 :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.11 :license: BSD, see LICENSE for details.12"""13 14from pygments.style import Style15from pygments.token import Comment, Error, Generic, Keyword, Name, Number, \16 Operator, String, Token17 18 19__all__ = ['SolarizedLightStyle', 'SolarizedDarkStyle']20 21 22def make_style(colors):23 return {24 Token: colors['base0'],25 26 Comment: 'italic ' + colors['base01'],27 Comment.Hashbang: colors['base01'],28 Comment.Multiline: colors['base01'],29 Comment.Preproc: 'noitalic ' + colors['magenta'],30 Comment.PreprocFile: 'noitalic ' + colors['base01'],31 32 Keyword: colors['green'],33 Keyword.Constant: colors['cyan'],34 Keyword.Declaration: colors['cyan'],35 Keyword.Namespace: colors['orange'],36 Keyword.Type: colors['yellow'],37 38 Operator: colors['base01'],39 Operator.Word: colors['green'],40 41 Name.Builtin: colors['blue'],42 Name.Builtin.Pseudo: colors['blue'],43 Name.Class: colors['blue'],44 Name.Constant: colors['blue'],45 Name.Decorator: colors['blue'],46 Name.Entity: colors['blue'],47 Name.Exception: colors['blue'],48 Name.Function: colors['blue'],49 Name.Function.Magic: colors['blue'],50 Name.Label: colors['blue'],51 Name.Namespace: colors['blue'],52 Name.Tag: colors['blue'],53 Name.Variable: colors['blue'],54 Name.Variable.Global:colors['blue'],55 Name.Variable.Magic: colors['blue'],56 57 String: colors['cyan'],58 String.Doc: colors['base01'],59 String.Regex: colors['orange'],60 61 Number: colors['cyan'],62 63 Generic: colors['base0'],64 Generic.Deleted: colors['red'],65 Generic.Emph: 'italic',66 Generic.Error: colors['red'],67 Generic.Heading: 'bold',68 Generic.Subheading: 'underline',69 Generic.Inserted: colors['green'],70 Generic.Output: colors['base0'],71 Generic.Prompt: 'bold ' + colors['blue'],72 Generic.Strong: 'bold',73 Generic.EmphStrong: 'bold italic',74 Generic.Traceback: colors['blue'],75 76 Error: 'bg:' + colors['red'],77 }78 79 80DARK_COLORS = {81 'base03': '#002b36',82 'base02': '#073642',83 'base01': '#586e75',84 'base00': '#657b83',85 'base0': '#839496',86 'base1': '#93a1a1',87 'base2': '#eee8d5',88 'base3': '#fdf6e3',89 'yellow': '#b58900',90 'orange': '#cb4b16',91 'red': '#dc322f',92 'magenta': '#d33682',93 'violet': '#6c71c4',94 'blue': '#268bd2',95 'cyan': '#2aa198',96 'green': '#859900',97}98 99LIGHT_COLORS = {100 'base3': '#002b36',101 'base2': '#073642',102 'base1': '#586e75',103 'base0': '#657b83',104 'base00': '#839496',105 'base01': '#93a1a1',106 'base02': '#eee8d5',107 'base03': '#fdf6e3',108 'yellow': '#b58900',109 'orange': '#cb4b16',110 'red': '#dc322f',111 'magenta': '#d33682',112 'violet': '#6c71c4',113 'blue': '#268bd2',114 'cyan': '#2aa198',115 'green': '#859900',116}117 118 119class SolarizedDarkStyle(Style):120 """121 The solarized style, dark.122 """123 124 name = 'solarized-dark'125 126 styles = make_style(DARK_COLORS)127 background_color = DARK_COLORS['base03']128 highlight_color = DARK_COLORS['base02']129 line_number_color = DARK_COLORS['base01']130 line_number_background_color = DARK_COLORS['base02']131 132 133class SolarizedLightStyle(SolarizedDarkStyle):134 """135 The solarized style, light.136 """137 138 name = 'solarized-light'139 140 styles = make_style(LIGHT_COLORS)141 background_color = LIGHT_COLORS['base03']142 highlight_color = LIGHT_COLORS['base02']143 line_number_color = LIGHT_COLORS['base01']144 line_number_background_color = LIGHT_COLORS['base02']145 