      }
    }
  }
  
  void HistoryLogModel::updateColors() {
    if (!display_signals_mode || sigs.empty()) {
      const auto freq = can->lastMessage(msg_id).freq;
      if (dynamic_mode) {
        for (auto it = messages.rbegin(); it != messages.rend(); ++it) {
          it->colors = hex_colors.compute(it->data, it->mono_time / (double)1e9, freq);
        }
      } else {
        for (auto it = messages.begin(); it != messages.end(); ++it) {
          it->colors = hex_colors.compute(it->data, it->mono_time / (double)1e9, freq);
        }
      }
    }
  }
  
  template <class InputIt>
  std::deque<HistoryLogModel::Message> HistoryLogModel::fetchData(InputIt first, InputIt last, uint64_t min_time) {
    std::deque<HistoryLogModel::Message> msgs;
    const auto [src, address] = DBCManager::parseId(msg_id);
    QVector<double> values(sigs.size());
 
</s> remove     auto it = std::upper_bound(events->begin(), events->end(), from_time, [=](uint64_t ts, auto &e) {
      return ts < e->mono_time;
    });
    return fetchData(it, events->end(), 0);
 </s> add     auto first = std::upper_bound(events->begin(), events->end(), from_time, [=](uint64_t ts, auto &e) { return ts < e->mono_time; });
    auto msgs = fetchData(first, events->end(), 0);
    if (update_colors) {
      for (auto it = msgs.rbegin(); it != msgs.rend(); ++it) {
        it->colors = hex_colors.compute(it->data, it->mono_time / (double)1e9, freq);
      }
    }
    return msgs; </s> remove     auto it = std::upper_bound(events->rbegin(), events->rend(), from_time, [=](uint64_t ts, auto &e) {
      return e->mono_time < ts;
    });
    return fetchData(it, events->rend(), min_time);
 </s> add     auto first = std::upper_bound(events->rbegin(), events->rend(), from_time, [=](uint64_t ts, auto &e) { return e->mono_time < ts; });
    auto msgs = fetchData(first, events->rend(), min_time);
    if (update_colors && min_time > 0) {
      for (auto it = msgs.rbegin(); it != msgs.rend(); ++it) {
        it->colors = hex_colors.compute(it->data, it->mono_time / (double)1e9, freq);
      }
    }
    return msgs; </s> remove       if (!dynamic_mode) {
        updateColors();
      }
 </s> add  </s> remove   void updateColors();
 </s> add 
      }
    }
  }
  















  template <class InputIt>
  std::deque<HistoryLogModel::Message> HistoryLogModel::fetchData(InputIt first, InputIt last, uint64_t min_time) {
    std::deque<HistoryLogModel::Message> msgs;
    const auto [src, address] = DBCManager::parseId(msg_id);
    QVector<double> values(sigs.size());
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 cabana: only update the colors of newly fetched messages in historylog (#27144)

only update new msgs color 
tools/cabana/historylog.cc