-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolors.py
More file actions
36 lines (32 loc) · 1.32 KB
/
colors.py
File metadata and controls
36 lines (32 loc) · 1.32 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
"""
A place for defining the default color scheme.
"""
import numpy as np
import matplotlib as mpl
def green_gold():
"""
Returns the green and gold colormap we use as the
default color scheme for this repository.
"""
color_map_size = 256
vals = np.ones((color_map_size, 4))
vals[:, 0] = np.linspace(20/256, 250/256, color_map_size)
vals[:, 1] = np.linspace(125/256, 230/256, color_map_size)
vals[:, 2] = np.linspace(0/256, 0/256, color_map_size)
cmap = mpl.colors.ListedColormap(vals)
return cmap
def maroon_white_aqua():
"""
Returns the green and gold colormap we use as the
default color scheme for plotting text.
"""
color_map_size = 256
vals = np.ones((color_map_size, 4))
vals[:int(color_map_size / 2), 0] = np.linspace(140/256, 1.0, int(color_map_size / 2))
vals[:int(color_map_size / 2), 1] = np.linspace(15/256, 1.0, int(color_map_size / 2))
vals[:int(color_map_size / 2), 2] = np.linspace(15/256, 1.0, int(color_map_size / 2))
vals[int(color_map_size / 2):, 0] = np.linspace(1.0, 0/256, int(color_map_size / 2))
vals[int(color_map_size / 2):, 1] = np.linspace(1.0, 220/256, int(color_map_size / 2))
vals[int(color_map_size / 2):, 2] = np.linspace(1.0, 170/256, int(color_map_size / 2))
cmap = mpl.colors.ListedColormap(vals)
return cmap