-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgruvbox.py
More file actions
108 lines (93 loc) · 3.09 KB
/
gruvbox.py
File metadata and controls
108 lines (93 loc) · 3.09 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
"""An opinionated terminal colorscheme for IPython using gruvbox colors.
Inspired or informed by the following:
- Pavel Pertsev's gruvbox colorscheme: https://git.io/JvV4I
- Dave Yarwood's gruvbox Pygments style: https://git.io/JvV4k
- python-mode's syntax highlighting: https://git.io/JvV4t
- The Pygments Python lexer: https://git.io/Jviis
"""
from dataclasses import dataclass
from typing import Any, Dict
from pygments.style import Style # type: ignore
from pygments.token import ( # type: ignore
Comment,
Error,
Keyword,
Name,
Number,
Operator,
String,
Text,
Token,
)
__author__: str = "Reilly Tucker Siemens"
__email__: str = "reilly@tuckersiemens.com"
__version__: str = "1.0.0"
@dataclass(frozen=True)
class Color:
"""Absolute colors as defined by gruvbox: https://git.io/JvV8i."""
dark0_hard: str = "#1d2021"
dark0: str = "#282828"
dark0_soft: str = "#32302f"
dark1: str = "#3c3836"
dark2: str = "#504945"
dark3: str = "#665c54"
dark4: str = "#7c6f64"
dark4_256: str = "#7c6f64"
gray_245: str = "#928374"
gray_244: str = "#928374"
light0_hard: str = "#f9f5d7"
light0: str = "#fbf1c7"
light0_soft: str = "#f2e5bc"
light1: str = "#ebdbb2"
light2: str = "#d5c4a1"
light3: str = "#bdae93"
light4: str = "#a89984"
light4_256: str = "#a89984"
bright_red: str = "#fb4934"
bright_green: str = "#b8bb26"
bright_yellow: str = "#fabd2f"
bright_blue: str = "#83a598"
bright_purple: str = "#d3869b"
bright_aqua: str = "#8ec07c"
bright_orange: str = "#fe8019"
neutral_red: str = "#cc241d"
neutral_green: str = "#98971a"
neutral_yellow: str = "#d79921"
neutral_blue: str = "#458588"
neutral_purple: str = "#b16286"
neutral_aqua: str = "#689d6a"
neutral_orange: str = "#d65d0e"
faded_red: str = "#9d0006"
faded_green: str = "#79740e"
faded_yellow: str = "#b57614"
faded_blue: str = "#076678"
faded_purple: str = "#8f3f71"
faded_aqua: str = "#427b58"
faded_orange: str = "#af3a03"
class GruvboxStyle(Style):
"""An opinionated terminal colorscheme for IPython using gruvbox colors."""
styles: Dict[Any, str] = {
Comment: Color.gray_245,
Error: Color.bright_red,
Keyword.Namespace: Color.bright_blue,
Keyword.Constant: Color.bright_orange,
Keyword.Type: Color.bright_yellow,
Keyword: Color.bright_red,
Name.Builtin.Pseudo: Color.bright_blue,
Name.Builtin: Color.bright_yellow,
Name.Class: Color.bright_yellow,
Name.Decorator: f"{Color.bright_green} bold",
Name.Exception: Color.bright_red,
Name.Function: Color.bright_aqua,
Name.Variable.Magic: Color.bright_orange,
Name: Color.light1,
Number: Color.bright_purple,
Operator.Word: Color.bright_red,
Operator: Color.light1,
String.Affix: Color.light1,
String.Escape: Color.bright_orange,
String.Interpol: Color.bright_orange,
String: Color.bright_green,
Text: Color.light1,
Token.Punctuation: Color.light1,
}