Skip to content

Commit

Permalink
Fix minor logic
Browse files Browse the repository at this point in the history
  • Loading branch information
KSP-TaxiService committed Jan 11, 2018
1 parent 6a8bb78 commit 733c5a0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/CommNetConstellation/CommNetLayer/CNCCommNetUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,12 @@ private void updateCustomisedView()
for (int i = numLinks-1; i >= 0; i--)
{
CommLink commLink = net.Links[i];
float f = (float)net.Links[i].GetBestSignal();
float t = Mathf.Pow(f, this.colorLerpPower);
float lvl = Mathf.Pow((float)net.Links[i].GetBestSignal(), this.colorLerpPower);
Color customHighColor = getConstellationColor(commLink.a, commLink.b);
if (this.swapHighLow)
this.line.SetColor(Color.Lerp(customHighColor, this.colorLow, t), i);
this.line.SetColor(Color.Lerp(customHighColor, this.colorLow, lvl), i);
else
this.line.SetColor(Color.Lerp(this.colorLow, customHighColor, t), i);
this.line.SetColor(Color.Lerp(this.colorLow, customHighColor, lvl), i);
}
break;
}
Expand Down

0 comments on commit 733c5a0

Please sign in to comment.