Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/Common/Palettes/DelegatePalette.cs @ 13757

Last change on this file since 13757 was 12503, checked in by aballeit, 10 years ago

#2283 added GUI and charts; fixed MCTS

File size: 533 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows.Media;
6
7namespace Microsoft.Research.DynamicDataDisplay.Common.Palettes
8{
9  public sealed class DelegatePalette : PaletteBase
10  {
11    public DelegatePalette(Func<double, Color> func)
12    {
13      if (func == null)
14        throw new ArgumentNullException("func");
15
16      this.func = func;
17    }
18
19    private readonly Func<double, Color> func;
20
21    public override Color GetColor(double t)
22    {
23      return func(t);
24    }
25  }
26}
Note: See TracBrowser for help on using the repository browser.