Rev | Line | |
---|
[12503] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using System.Windows.Media;
|
---|
| 6 |
|
---|
| 7 | namespace 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.