Skip to content

Commit

Permalink
Merge pull request #101 from philipbelesky/viridis-fix
Browse files Browse the repository at this point in the history
Fix color palette failure in certain scenarios
  • Loading branch information
mariuszhermansdorfer authored Mar 23, 2022
2 parents 2c26a27 + 00b5a6a commit 194c9d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion SandWorm/Analytics/Elevation.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Drawing;
using System.Collections.Generic;
using Rhino.Display;
using System;

namespace SandWorm.Analytics
{
Expand Down Expand Up @@ -49,7 +50,7 @@ public override void ComputeLookupTableForAnalysis(double sensorElevation, doubl
{
var elevationRange = new Analysis.VisualisationRangeWithColor
{
ValueSpan = (int)(gradientRange / swatchCount),
ValueSpan = Math.Max((int)(gradientRange / swatchCount), 1), // Prevent 0 value
ColorStart = new ColorHSL(paletteSwatches[i]),
ColorEnd = new ColorHSL(paletteSwatches[i+1])
};
Expand Down

0 comments on commit 194c9d6

Please sign in to comment.