Skip to content

Commit

Permalink
Fixed non HTML5 compliant color code
Browse files Browse the repository at this point in the history
  • Loading branch information
brewster76 committed Oct 20, 2018
1 parent f60219d commit ae3f7b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bin/user/historygenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,14 @@ def _colorCell(self, value, format_string, cellColours):
value: Numeric value for the observation
format_string: How the numberic value should be represented in the table cell.
cellColours: An array containing 3 lists. [minvalues], [maxvalues], [html colour code]
cellColours: An array containing 4 lists. [minvalues], [maxvalues], [background color], [foreground color]
"""

if value is not None:
cellText = "<td"

for c in cellColours:
if (value >= int(c[0])) and (value <= int(c[1])):
if (value >= float(c[0])) and (value <= float(c[1])):
cellText += " style=\"background-color:%s; color:%s\"" % (c[2], c[3])

formatted_value = format_string % value
Expand Down
6 changes: 3 additions & 3 deletions skins/Bootstrap/skin.conf
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@
# fontColours = foreground colour [optional, defaults to black if omitted]

# Default is temperature scale
minvalues = -50, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35
maxvalues = -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 60
colours = "#0029E5", "#0186E7", "#02E3EA", "#04EC97", "#05EF3D2", "#2BF207", "#8AF408", "#E9F70A", "#F9A90B", "#FC4D0D", "#FF0F2D"
minvalues = -50, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35
maxvalues = -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 60
colours = "#0029E5", "#0186E7", "#02E3EA", "#04EC97", "#05EF3D", "#2BF207", "#8AF408", "#E9F70A", "#F9A90B", "#FC4D0D", "#FF0F2D"
fontColours = "#FFFFFF", "#FFFFFF", "#000000", "#000000", "#000000", "#000000", "#000000", "#000000", "#FFFFFF", "#FFFFFF", "#FFFFFF"
monthnames = Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec

Expand Down

0 comments on commit ae3f7b6

Please sign in to comment.