-
Notifications
You must be signed in to change notification settings - Fork 6
/
pylake_syntax_theme.py
77 lines (72 loc) · 2.33 KB
/
pylake_syntax_theme.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
from pygments.style import Style
from pygments.token import (
Comment,
Error,
Generic,
Name,
Number,
Operator,
String,
Text,
Whitespace,
Keyword,
)
colors = {
"white": "#ffffff",
"gray": "#404041",
"mediumgray": "#929294",
"lightgray": "#d9d9d9",
"lightestgray": "#f0f0f0",
"pink": "#d30359",
"green": "#569a45",
"blue": "#0049a9",
"orange": "#e06700",
"lightpink": "#f9d1d5",
"lightgreen": "#cee6c8",
"lightblue": "#a5ddf4",
"lightorange": "#fcdfb7",
}
class PylakeStyle(Style):
"""
Syntax highlighting with the pylake logo colors
"""
background_color = colors["lightestgray"]
styles = {
Comment: f'italic {colors["mediumgray"]}',
Comment.Preproc: "noitalic",
Comment.Special: "bold",
Error: f'bg:{colors["pink"]} {colors["white"]}',
Generic.Deleted: f'border:{colors["pink"]} bg:{colors["lightpink"]}',
Generic.Emph: "italic",
Generic.Error: colors["pink"],
Generic.Heading: f'bold {colors["blue"]}',
Generic.Inserted: "border:{} bg:{}".format(colors["green"], colors["lightgreen"]),
Generic.Output: colors["gray"],
Generic.Prompt: f'bold {colors["blue"]}',
Generic.Strong: "bold",
Generic.Subheading: f'bold {colors["blue"]}',
Generic.Traceback: colors["pink"],
Keyword: f'bold {colors["green"]}',
Keyword.Pseudo: "nobold",
Keyword.Type: colors["pink"],
Name.Attribute: f'italic {colors["blue"]}',
Name.Builtin: f'bold {colors["green"]}',
Name.Class: "underline",
Name.Namespace: f'bold {colors["blue"]}',
Name.Constant: colors["orange"],
Name.Decorator: f'bold {colors["orange"]}',
Name.Entity: f'bold {colors["pink"]}',
Name.Exception: f'bold {colors["pink"]}',
Name.Function: f'bold {colors["orange"]}',
Name.Tag: f'bold {colors["blue"]}',
Number: f'{colors["orange"]}',
Operator: colors["blue"],
Operator.Word: f'bold {colors["blue"]}',
String: f'{colors["pink"]}',
String.Doc: "italic",
String.Escape: f'bold {colors["pink"]}',
String.Other: colors["orange"],
String.Symbol: f'bold {colors["pink"]}',
Text: colors["gray"],
Whitespace: colors["lightestgray"],
}