Changeset 9404


Ignore:
Timestamp:
04/30/13 10:36:40 (6 years ago)
Author:
gkronber
Message:

#1789 added logarithmic scaling for transparency value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs

    r9340 r9404  
    733733        foreach (var point in runToDataPointMapping[run]) {
    734734          point.MarkerStyle = MarkerStyle.Circle;
    735           point.Color = Color.FromArgb(255 - transparencyTrackBar.Value, run.Color);
     735          point.Color = Color.FromArgb(255 - LogTransform(transparencyTrackBar.Value), run.Color);
    736736        }
    737737      }
    738738      selectedRuns.Clear();
     739    }
     740
     741    // returns a value in [0..255]
     742    private int LogTransform(int x) {
     743      double min = transparencyTrackBar.Minimum;
     744      double max = transparencyTrackBar.Maximum;
     745      double r = (x - min) / (max - min);  // r \in [0..1]
     746      double l = Math.Log(r + 1) / Math.Log(2.0); // l \in [0..1]
     747      return (int)Math.Round(255.0 * l);
    739748    }
    740749
Note: See TracChangeset for help on using the changeset viewer.