Skip to content

Commit

Permalink
fixed bug with white colors from config file
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyingBird95 committed Mar 11, 2018
1 parent 23efbf8 commit 777b37e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Changed

- Updated functionality to retrieve the stacktrace of an Outlier

- Fixed bug with white colors from the config option

v1.10.0
----------
Expand Down
3 changes: 2 additions & 1 deletion flask_monitoringdashboard/colors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from colorhash import ColorHash
from flask_monitoringdashboard import config
import re


def get_color(hash):
Expand All @@ -10,7 +11,7 @@ def get_color(hash):
:return: a color (as string)
"""
if hash in config.colors:
rgb = config.colors[hash]
rgb = re.findall(r'\d+', config.colors[hash])
else:
rgb = ColorHash(hash).rgb
return 'rgb({0}, {1}, {2})'.format(rgb[0], rgb[1], rgb[2])

0 comments on commit 777b37e

Please sign in to comment.