-
Notifications
You must be signed in to change notification settings - Fork 0
/
nord_pygments.py
95 lines (85 loc) · 2.21 KB
/
nord_pygments.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
"""Nord highlighting style for Pygments
Nord is an arctic, north-bluish color palette by Arctic Ice Studio
<[email protected]> (https://www.arcticicestudio.com)
License: BSD-3 Clause License. See LICENSE for details
"""
from pygments.style import Style
from pygments.token import (
Token,
Keyword,
Name,
Comment,
String,
Error,
Number,
Operator,
Punctuation,
Generic,
Whitespace,
)
nord0 = "#2e3440"
nord1 = "#3b4252"
nord2 = "#434c5e"
nord3 = "#4c566a"
# nord3_bright = "#616e87"
nord3_bright = "#75829c"
nord4 = "#d8dee9"
nord5 = "#e5e9f0"
nord6 = "#eceff4"
nord7 = "#8fbcbb"
nord8 = "#88c0d0"
nord9 = "#81a1c1"
nord10 = "#5e81ac"
nord11 = "#bf616a"
nord12 = "#d08770"
nord13 = "#ebcb8b"
nord14 = "#a3be8c"
nord15 = "#b48ead"
class NordStyle(Style):
background_color = nord0
highlight_color = nord4
styles = {
Token: nord5,
Whitespace: nord4,
Comment: f"italic {nord3_bright}",
Comment.Preproc: nord10,
Comment.Special: f"bold {nord4}",
Keyword: f"bold {nord9}",
Keyword.Pseudo: f"nobold {nord9}",
Keyword.Type: f"nobold {nord9}",
Operator: nord9,
Operator.Word: f"bold {nord9}",
Name: nord4,
Name.Builtin: nord9,
Name.Function: nord8,
Name.Class: nord7,
Name.Namespace: nord7,
Name.Exception: nord11,
Name.Variable: nord4,
Name.Constant: nord7,
Name.Label: nord7,
Name.Entity: nord12,
Name.Attribute: nord7,
Name.Tag: nord9,
Name.Decorator: nord12,
Punctuation: nord6,
String: nord14,
String.Doc: nord4,
String.Interpol: nord14,
String.Escape: nord13,
String.Regex: nord13,
String.Symbol: nord14,
String.Other: nord14,
Number: nord15,
Generic.Heading: f"bold {nord8}",
Generic.Subheading: f"bold {nord8}",
Generic.Deleted: nord11,
Generic.Inserted: nord14,
Generic.Error: nord11,
Generic.Emph: "italic",
Generic.Strong: "bold",
Generic.Prompt: f"bold {nord3}",
Generic.Output: nord4,
Generic.Traceback: nord11,
Error: nord11,
}