Skip to content

Commit

Permalink
mavproxy_link: use numeric code for green
Browse files Browse the repository at this point in the history
unreadable on Window's concept of "green", so I swiped the RGB values from Linux
  • Loading branch information
peterbarker committed Oct 6, 2024
1 parent ddf457b commit 0274c57
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions MAVProxy/modules/mavproxy_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,9 @@ def handle_msec_timestamp(self, m, master):
master.link_delayed = False

def colors_for_severity(self, severity):
# Windows and Linux have wildly difference concepts of
# "green",so use specific RGB values:
green = (0, 128, 0)
severity_colors = {
# tuple is (fg, bg) (as in "white on red")
mavutil.mavlink.MAV_SEVERITY_EMERGENCY: ('white', 'red'),
Expand All @@ -574,8 +577,8 @@ def colors_for_severity(self, severity):
mavutil.mavlink.MAV_SEVERITY_ERROR: ('black', 'orange'),
mavutil.mavlink.MAV_SEVERITY_WARNING: ('black', 'orange'),
mavutil.mavlink.MAV_SEVERITY_NOTICE: ('black', 'yellow'),
mavutil.mavlink.MAV_SEVERITY_INFO: ('white', 'green'),
mavutil.mavlink.MAV_SEVERITY_DEBUG: ('white', 'green'),
mavutil.mavlink.MAV_SEVERITY_INFO: ('white', green),
mavutil.mavlink.MAV_SEVERITY_DEBUG: ('white', green),
}
try:
return severity_colors[severity]
Expand Down

0 comments on commit 0274c57

Please sign in to comment.