statworx_theme 2.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- statworx_theme/__init__.py +16 -0
- statworx_theme/colormaps.py +95 -0
- statworx_theme/colors.py +60 -0
- statworx_theme/py.typed +0 -0
- statworx_theme/styles/statworx.mplstyle +872 -0
- statworx_theme/utils.py +407 -0
- statworx_theme-2.0.2.dist-info/LICENSE +21 -0
- statworx_theme-2.0.2.dist-info/METADATA +141 -0
- statworx_theme-2.0.2.dist-info/RECORD +10 -0
- statworx_theme-2.0.2.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""statworx_theme module."""
|
|
2
|
+
|
|
3
|
+
from .colormaps import * # noqa: F403
|
|
4
|
+
from .utils import (
|
|
5
|
+
apply_custom_colors,
|
|
6
|
+
apply_custom_colors_altair,
|
|
7
|
+
apply_custom_colors_plotly,
|
|
8
|
+
apply_style,
|
|
9
|
+
apply_style_altair,
|
|
10
|
+
apply_style_plotly,
|
|
11
|
+
get_stwx_cmaps,
|
|
12
|
+
register_blended_cmap,
|
|
13
|
+
register_listed_cmap,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
__version__ = "2.0.2"
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"""Colormaps for the statworx theme."""
|
|
2
|
+
|
|
3
|
+
from itertools import product
|
|
4
|
+
|
|
5
|
+
from .colors import (
|
|
6
|
+
BLACK,
|
|
7
|
+
BLUE,
|
|
8
|
+
COLOR_DICT,
|
|
9
|
+
DARK_GREEN,
|
|
10
|
+
DARK_RED,
|
|
11
|
+
DEEP_BLUE,
|
|
12
|
+
DEEP_CYAN,
|
|
13
|
+
DEEP_GREEN,
|
|
14
|
+
DEEP_GREY,
|
|
15
|
+
DEEP_ORANGE,
|
|
16
|
+
DEEP_RED,
|
|
17
|
+
DEEP_VIOLET,
|
|
18
|
+
DEEP_YELLOW,
|
|
19
|
+
LIGHT_BLUE,
|
|
20
|
+
LIGHT_GREEN,
|
|
21
|
+
LIGHT_GREY,
|
|
22
|
+
LIGHT_RED,
|
|
23
|
+
WHITE,
|
|
24
|
+
)
|
|
25
|
+
from .utils import register_blended_cmap, register_listed_cmap
|
|
26
|
+
|
|
27
|
+
####################################################################################################
|
|
28
|
+
# DISCRETE COLORMAPS
|
|
29
|
+
####################################################################################################
|
|
30
|
+
|
|
31
|
+
standard_colors = [
|
|
32
|
+
BLUE,
|
|
33
|
+
LIGHT_GREY,
|
|
34
|
+
LIGHT_BLUE,
|
|
35
|
+
DEEP_GREY,
|
|
36
|
+
DARK_RED,
|
|
37
|
+
LIGHT_GREEN,
|
|
38
|
+
LIGHT_RED,
|
|
39
|
+
DARK_GREEN,
|
|
40
|
+
]
|
|
41
|
+
standard_cmap = register_listed_cmap(standard_colors, "stwx:standard")
|
|
42
|
+
|
|
43
|
+
alternative_colors = [
|
|
44
|
+
BLUE,
|
|
45
|
+
LIGHT_GREY,
|
|
46
|
+
DARK_RED,
|
|
47
|
+
LIGHT_GREEN,
|
|
48
|
+
LIGHT_BLUE,
|
|
49
|
+
DEEP_GREY,
|
|
50
|
+
LIGHT_RED,
|
|
51
|
+
DARK_GREEN,
|
|
52
|
+
]
|
|
53
|
+
alternative_cmap = register_listed_cmap(alternative_colors, "stwx:alternative")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
deep_colors = [
|
|
57
|
+
DEEP_BLUE,
|
|
58
|
+
DEEP_RED,
|
|
59
|
+
DEEP_GREEN,
|
|
60
|
+
DEEP_VIOLET,
|
|
61
|
+
DEEP_CYAN,
|
|
62
|
+
DEEP_ORANGE,
|
|
63
|
+
]
|
|
64
|
+
deep_cmap = register_listed_cmap(deep_colors, "stwx:deep")
|
|
65
|
+
|
|
66
|
+
####################################################################################################
|
|
67
|
+
# BLENDED COLORMAPS
|
|
68
|
+
####################################################################################################
|
|
69
|
+
|
|
70
|
+
bad2good_colors = [DARK_RED, DEEP_YELLOW, DARK_GREEN]
|
|
71
|
+
bad2good_cmap = register_blended_cmap(bad2good_colors, "stwx:bad2good")
|
|
72
|
+
|
|
73
|
+
good2bad_colors = [DARK_GREEN, DEEP_YELLOW, DARK_RED]
|
|
74
|
+
good2bad_cmap = register_blended_cmap(good2bad_colors, "stwx:good2bad")
|
|
75
|
+
|
|
76
|
+
for (name1, color1), (name2, color2) in product(COLOR_DICT.items(), COLOR_DICT.items()):
|
|
77
|
+
cmap_colors_ = [color1, WHITE, color2]
|
|
78
|
+
cmap_name_ = f"stwx:{name1}{name2}_diverging"
|
|
79
|
+
register_blended_cmap(cmap_colors_, cmap_name_)
|
|
80
|
+
|
|
81
|
+
for (name1, color1), (name2, color2) in product(COLOR_DICT.items(), COLOR_DICT.items()):
|
|
82
|
+
if name1 != name2:
|
|
83
|
+
cmap_colors_ = [color1, color2]
|
|
84
|
+
cmap_name_ = f"stwx:{name1}{name2}_blend"
|
|
85
|
+
register_blended_cmap(cmap_colors_, cmap_name_)
|
|
86
|
+
|
|
87
|
+
for name, color in COLOR_DICT.items():
|
|
88
|
+
cmap_colors_ = [color, WHITE]
|
|
89
|
+
cmap_name_ = f"stwx:{name}_fade"
|
|
90
|
+
register_blended_cmap(cmap_colors_, cmap_name_)
|
|
91
|
+
|
|
92
|
+
for name, color in COLOR_DICT.items():
|
|
93
|
+
cmap_colors_ = [BLACK, color, WHITE]
|
|
94
|
+
cmap_name_ = f"stwx:{name}_rise"
|
|
95
|
+
register_blended_cmap(cmap_colors_, cmap_name_)
|
statworx_theme/colors.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""Color definitions for the statworx theme."""
|
|
2
|
+
|
|
3
|
+
from typing import Final
|
|
4
|
+
|
|
5
|
+
# black and white
|
|
6
|
+
BLACK = "#000000"
|
|
7
|
+
WHITE = "#FFFFFF"
|
|
8
|
+
|
|
9
|
+
# GREY
|
|
10
|
+
DEEP_GREY = "#6C7D8C"
|
|
11
|
+
DARK_GREY = "#7D8AA4"
|
|
12
|
+
DARKER_GREY = "#283440"
|
|
13
|
+
GRAY = "#B6BDCC"
|
|
14
|
+
LIGHT_GREY = "#9BAEC1"
|
|
15
|
+
LIGHTER_GREY = "#EBF0F2"
|
|
16
|
+
|
|
17
|
+
# YELLOW
|
|
18
|
+
DEEP_YELLOW = "#FFFF00"
|
|
19
|
+
|
|
20
|
+
# VIOLEt
|
|
21
|
+
DEEP_VIOLET = "#7f00ff"
|
|
22
|
+
|
|
23
|
+
# CYAN
|
|
24
|
+
DEEP_CYAN = "#01BAEF"
|
|
25
|
+
|
|
26
|
+
# ORANGE
|
|
27
|
+
DEEP_ORANGE = "#FF781F"
|
|
28
|
+
|
|
29
|
+
# BLUE
|
|
30
|
+
DEEP_BLUE = "#0000FF"
|
|
31
|
+
BLUE = "#0000BF"
|
|
32
|
+
LIGHT_BLUE = "#9999FF"
|
|
33
|
+
|
|
34
|
+
# RED
|
|
35
|
+
DARK_RED = "#C7014F"
|
|
36
|
+
DEEP_RED = "#FE0D6C"
|
|
37
|
+
LIGHT_RED = "#FF9EC4"
|
|
38
|
+
|
|
39
|
+
# GREEN
|
|
40
|
+
DEEP_GREEN = "#00C800"
|
|
41
|
+
LIGHT_GREEN = "#83FF83"
|
|
42
|
+
DARK_GREEN = "#009600"
|
|
43
|
+
|
|
44
|
+
# define standard colors
|
|
45
|
+
C0 = BLUE
|
|
46
|
+
C1 = LIGHT_GREY
|
|
47
|
+
C2 = LIGHT_BLUE
|
|
48
|
+
C3 = DEEP_GREY
|
|
49
|
+
C4 = DARK_RED
|
|
50
|
+
C5 = LIGHT_GREEN
|
|
51
|
+
C6 = LIGHT_RED
|
|
52
|
+
C7 = DARK_GREEN
|
|
53
|
+
|
|
54
|
+
# create color dict
|
|
55
|
+
COLOR_DICT: Final[dict[str, str]] = {
|
|
56
|
+
"Rd": DARK_RED,
|
|
57
|
+
"Bl": BLUE,
|
|
58
|
+
"Gn": DARK_GREEN,
|
|
59
|
+
"Yw": DEEP_YELLOW,
|
|
60
|
+
}
|
statworx_theme/py.typed
ADDED
|
File without changes
|