<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Color display for sector times from Lovely Dashboard - Projects				            </title>
            <link>https://www.simhubdash.com/community-2/projects/color-display-for-sector-times/</link>
            <description>All about SimHub!</description>
            <language>en-US</language>
            <lastBuildDate>Fri, 08 May 2026 07:51:07 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Color display for sector times from Lovely Dashboard</title>
                        <link>https://www.simhubdash.com/community-2/projects/color-display-for-sector-times/#post-9601</link>
                        <pubDate>Wed, 23 Oct 2024 05:19:35 +0000</pubDate>
                        <description><![CDATA[**UPDATE**
So here is a update that nobody ask for, but I think I solved the problem, but if anyone with more coding skill would like to take a look at it and debug you are more than welcom...]]></description>
                        <content:encoded><![CDATA[<p><strong>**UPDATE**</strong></p>
<p><span>So here is a update that nobody ask for</span><span>, but I think I solved the problem</span><span>, but if anyone with more coding skill would like to take a look at it and debug you are more than welcome</span><span>.</span></p>
<p><span>Now it should show the sector difference between you and the driver ahead/behind for each sector on the current lap, and a sector summary after the lap. If I'm faster thru a sector is displays as green under my opponents name and red if I'm slower.</span></p>
<p>This is inspired by and made possible from the sector color bars from Lovely Dashboard.</p>
<p><span>The code for the </span><strong><span>SectorDeltaReview </span><span>&gt; BackgroundColor</span><span>:</span></strong></p>
<pre contenteditable="false">function LastSectorColor(sector) {
var mySector = timespantoseconds(driversectorlastlap((getplayerleaderboardposition()), sector, false));
var behindSector = timespantoseconds(driversectorlastlap((getplayerleaderboardposition()+1), sector, false));
var diff = (mySector-behindSector);

if (diff &gt; 0) {
    return 'Tomato';
    } else {
    return 'SpringGreen';
    }
}    
return LastSectorColor( repeatindex() )</pre>
<p><span>The code for the </span><strong><span>SectorDelta </span><span>&gt; BackgroundColor</span><span>:</span></strong></p>
<pre contenteditable="false">function driverSectorSegmentColor(driver, sector) {
    
var timeDiff = timespantoseconds( driversectorcurrentlap( driverPos, sector, false) ) - 
                    timespantoseconds( driversectorcurrentlap( driverBehind, sector, false) );
                    
if (sector &gt;= drivercurrentsector( driver ) ) {
    return '#FF444444';
    } else if (timeDiff &gt; 0) {
        return 'Tomato';
    } else if (timeDiff &lt; 0) {
        return 'SpringGreen';
    } else {
        return 'FFFF6347';
    }

}

var driverPos = getplayerleaderboardposition();
var driverBehind = (getplayerleaderboardposition()+1);
return driverSectorSegmentColor( driverPos, repeatindex() )</pre>
<p>_________________________________________________________</p>
<p>I don't know if this is the right place, if not, I'm sorry.<br /><br />Since I switched to VR, I no longer use the Lovely Dashboard, but I do stream and I have created a overlay that uses one part of the Lovely Dashboard that I really enjoyed, and it's the colored sector bars (see picture). But I would like to have it show the sector difference between my sector times and the driver ahead/behind. I have tinkered a lot with the code, but I lack the coding skills to make it work 100%. I can make it work for all the sector on the current lap, except the last sector, and the sector review doesn't work at all, see below.<br /><br />What I would like is to have the sector color bars on my overlay under the driver behind/ahead (second image, bottom left and bottom right) so that if I'm faster thru sector 1 compared to the driver behind it will turn green, and then the diff in sector 2 and so on, if it makes any sense.<br /><br />Since I race in VR i don't see it anyways but it would be a cool overlay, just like the F1 broadcast.<br />Thanks</p>
<p><strong>This is the code so far that I've added in the BackgroundColor for the SectorDelta (rectangle)</strong></p>
<div> </div>
<div id="wpfa-2550" class="wpforo-attached-file"> </div>
<div id="wpfa-2551" class="wpforo-attached-file"><a class="wpforo-default-attachment" title="obs64_NSjHCT0DXl.png" href="//www.simhubdash.com/wp-content/uploads/wpforo/default_attachments/1729725786-obs64_NSjHCT0DXl.png" target="_blank" rel="noopener"><i class="fas fa-paperclip"></i> obs64_NSjHCT0DXl.png</a></div>]]></content:encoded>
						                            <category domain="https://www.simhubdash.com/community-2/projects/">Projects</category>                        <dc:creator>ehsanmomeni</dc:creator>
                        <guid isPermaLink="true">https://www.simhubdash.com/community-2/projects/color-display-for-sector-times/#post-9601</guid>
                    </item>
							        </channel>
        </rss>
		