Skip to content

Commit 49ef450

Browse files
committed
config color values not being strings
1 parent 09b07f6 commit 49ef450

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The following things can be configured:
5454
N=5
5555
SUBMIT_RESULTS_URL=http://0.0.0.0:5000/dashboard/submit-test-results
5656
OUTLIER_DETECTION_CONSTANT=2.5
57-
COLORS={'main': '[0,97,255]', 'static': '[255,153,0]'}
57+
COLORS={'main':[0,97,255], 'static':[255,153,0]}
5858

5959
For more information: [see this file](dashboard/config.py)
6060

dashboard/colors.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
from colorhash import ColorHash
22
from dashboard import config
33

4-
import ast
5-
64

75
def get_color(hash):
86
"""
9-
Returns an rgb-color (as string, which can be using in plotly) from a given hash
7+
Returns an rgb-color (as string, which can be using in plotly) from a given hash,
8+
if no color for that string was specified in the config file.
109
:param hash: the string that is translated into a color
1110
:return: a color (as string)
1211
"""
1312
if hash in config.colors:
14-
rgb = ast.literal_eval(config.colors[hash])
13+
rgb = config.colors[hash]
1514
else:
1615
rgb = ColorHash(hash).rgb
1716
return 'rgb({0}, {1}, {2})'.format(rgb[0], rgb[1], rgb[2])

0 commit comments

Comments
 (0)