This commit is contained in:
Your Name
2024-05-02 20:35:11 -05:00
parent f0c82bf2d2
commit 526612b2bf

View File

@@ -879,16 +879,16 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
QColor base_color = QColor::fromRgb(base_red, base_green, base_blue);
float _h, _s, _l;
base_color.getHslF(&_h, &_s, &_l);
base_color.getHslF(&_h, &_s, &_l); // Extracting HSL values from the base color
// Calculate saturation and lightness based on acceleration
float adjusted_saturation = std::min(std::abs(acceleration[i] * 1.5f), 1.f);
float adjusted_lightness = util::map_val(adjusted_saturation, 0.f, 1.f, 0.62f, 0.95f);
float adjusted_lightness = util::map_val(adjusted_saturation, 0.f, 1.f, _l, 0.95f); // Using base lightness as a starting point
// Calculate dynamic alpha based on lin_grad_point
float dynamic_alpha = util::map_val(lin_grad_point, 0.75f / 2.f, 0.75f, base_alpha, 0.f);
QColor final_color = QColor::fromHslF(h / 360.f, adjusted_saturation, adjusted_lightness, dynamic_alpha);
QColor final_color = QColor::fromHslF(_h / 360.f, adjusted_saturation, adjusted_lightness, dynamic_alpha);
bg.setColorAt(lin_grad_point, final_color);
i += (i + 2) < max_len ? 1 : 0; // Skipping a point to optimize rendering