# Path: asammdf/gui/utils.py
# def get_colors_using_ranges(
#     value, ranges, default_background_color, default_font_color
# ):
#     new_background_color = default_background_color
#     new_font_color = default_font_color
# 
#     if value is None:
#         return new_background_color, new_font_color
# 
#     if ranges:
# 
#         for base_class in (float, int, np.number):
#             if isinstance(value, base_class):
#                 for range_info in ranges:
# 
#                     (
#                         background_color,
#                         font_color,
#                         op1,
#                         op2,
#                         value1,
#                         value2,
#                     ) = range_info.values()
# 
#                     result = False
# 
#                     if isinstance(value1, float):
#                         if op1 == "==":
#                             result = value1 == value
#                         elif op1 == "!=":
#                             result = value1 != value
#                         elif op1 == "<=":
#                             result = value1 <= value
#                         elif op1 == "<":
#                             result = value1 < value
#                         elif op1 == ">=":
#                             result = value1 >= value
#                         elif op1 == ">":
#                             result = value1 > value
# 
#                         if not result:
#                             continue
# 
#                     if isinstance(value2, float):
#                         if op2 == "==":
#                             result = value == value2
#                         elif op2 == "!=":
#                             result = value != value2
#                         elif op2 == "<=":
#                             result = value <= value2
#                         elif op2 == "<":
#                             result = value < value2
#                         elif op2 == ">=":
#                             result = value >= value2
#                         elif op2 == ">":
#                             result = value > value2
# 
#                         if not result:
#                             continue
# 
#                     if result:
# 
#                         new_background_color = background_color
#                         new_font_color = font_color
#                         break
#                 break
#         else:
#             # str here
# 
#             for range_info in ranges:
# 
#                 (
#                     background_color,
#                     font_color,
#                     op1,
#                     op2,
#                     value1,
#                     value2,
#                 ) = range_info.values()
# 
#                 result = False
# 
#                 if isinstance(value1, str):
#                     if op1 == "==":
#                         result = value1 == value
#                     elif op1 == "!=":
#                         result = value1 != value
#                     elif op1 == "<=":
#                         result = value1 <= value
#                     elif op1 == "<":
#                         result = value1 < value
#                     elif op1 == ">=":
#                         result = value1 >= value
#                     elif op1 == ">":
#                         result = value1 > value
# 
#                     if not result:
#                         continue
# 
#                 if isinstance(value2, str):
#                     if op2 == "==":
#                         result = value == value2
#                     elif op2 == "!=":
#                         result = value != value2
#                     elif op2 == "<=":
#                         result = value <= value2
#                     elif op2 == "<":
#                         result = value < value2
#                     elif op2 == ">=":
#                         result = value >= value2
#                     elif op2 == ">":
#                         result = value > value2
# 
#                     if not result:
#                         continue
# 
#                 if result:
#                     new_background_color = background_color
#                     new_font_color = font_color
#                     break
# 
#     return new_background_color, new_font_color


from time import perf_counter
from traceback import format_exc
from PyQt5 import QtCore, QtGui, QtWidgets
from ..utils import get_colors_using_ranges

        else:
            return super().__lt__(other)

    def __del__(self):
        self.entry = self.name = self.mdf_uuid = None

    def check_signal_range(self, value=None):
        if value is None:
            value = self.text(1).strip()
            if value:
                try:
                    value = float(value)
                except:
                    if value.startswith("0x"):
                        try:
                            value = float(int(value, 16))
                        except:
                            pass
                    elif value.startswith("0b"):
                        try:
                            value = float(int(value, 2))
                        except:
                            pass
            else:
                value = None

        default_background_color = self._back_ground_color
        default_font_color = self._font_color


# Path: asammdf/gui/utils.py
# def get_colors_using_ranges(
#     value, ranges, default_background_color, default_font_color
# ):
#     new_background_color = default_background_color
#     new_font_color = default_font_color
# 
#     if value is None:
#         return new_background_color, new_font_color
# 
#     if ranges:
# 
#         for base_class in (float, int, np.number):
#             if isinstance(value, base_class):
#                 for range_info in ranges:
# 
#                     (
#                         background_color,
#                         font_color,
#                         op1,
#                         op2,
#                         value1,
#                         value2,
#                     ) = range_info.values()
# 
#                     result = False
# 
#                     if isinstance(value1, float):
#                         if op1 == "==":
#                             result = value1 == value
#                         elif op1 == "!=":
#                             result = value1 != value
#                         elif op1 == "<=":
#                             result = value1 <= value
#                         elif op1 == "<":
#                             result = value1 < value
#                         elif op1 == ">=":
#                             result = value1 >= value
#                         elif op1 == ">":
#                             result = value1 > value
# 
#                         if not result:
#                             continue
# 
#                     if isinstance(value2, float):
#                         if op2 == "==":
#                             result = value == value2
#                         elif op2 == "!=":
#                             result = value != value2
#                         elif op2 == "<=":
#                             result = value <= value2
#                         elif op2 == "<":
#                             result = value < value2
#                         elif op2 == ">=":
#                             result = value >= value2
#                         elif op2 == ">":
#                             result = value > value2
# 
#                         if not result:
#                             continue
# 
#                     if result:
# 
#                         new_background_color = background_color
#                         new_font_color = font_color
#                         break
#                 break
#         else:
#             # str here
# 
#             for range_info in ranges:
# 
#                 (
#                     background_color,
#                     font_color,
#                     op1,
#                     op2,
#                     value1,
#                     value2,
#                 ) = range_info.values()
# 
#                 result = False
# 
#                 if isinstance(value1, str):
#                     if op1 == "==":
#                         result = value1 == value
#                     elif op1 == "!=":
#                         result = value1 != value
#                     elif op1 == "<=":
#                         result = value1 <= value
#                     elif op1 == "<":
#                         result = value1 < value
#                     elif op1 == ">=":
#                         result = value1 >= value
#                     elif op1 == ">":
#                         result = value1 > value
# 
#                     if not result:
#                         continue
# 
#                 if isinstance(value2, str):
#                     if op2 == "==":
#                         result = value == value2
#                     elif op2 == "!=":
#                         result = value != value2
#                     elif op2 == "<=":
#                         result = value <= value2
#                     elif op2 == "<":
#                         result = value < value2
#                     elif op2 == ">=":
#                         result = value >= value2
#                     elif op2 == ">":
#                         result = value > value2
# 
#                     if not result:
#                         continue
# 
#                 if result:
#                     new_background_color = background_color
#                     new_font_color = font_color
#                     break
# 
#     return new_background_color, new_font_color


# Path: asammdf/gui/widgets/tree_item.py
from time import perf_counter
from traceback import format_exc
from PyQt5 import QtCore, QtGui, QtWidgets
from ..utils import get_colors_using_ranges


        else:
            return super().__lt__(other)

    def __del__(self):
        self.entry = self.name = self.mdf_uuid = None

    def check_signal_range(self, value=None):
        if value is None:
            value = self.text(1).strip()
            if value:
                try:
                    value = float(value)
                except:
                    if value.startswith("0x"):
                        try:
                            value = float(int(value, 16))
                        except:
                            pass
                    elif value.startswith("0b"):
                        try:
                            value = float(int(value, 2))
                        except:
                            pass
            else:
                value = None

        default_background_color = self._back_ground_color
        default_font_color = self._font_color


        new_background_color, new_font_color = get_colors_using_ranges(