def colorize_can_id(frame): if not frame.extended: return mask = 0b11111 priority = (frame.id >> 24) & mask col = QColor() col.setRgb(0xFF, 0xFF - (mask - priority) * 6, 0xFF) return col