PageRenderTime 14ms CodeModel.GetById 10ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Main/src/DynamicDataDisplay/Common/Palettes/TransparentLimitsPalette.cs

#
C# | 21 lines | 18 code | 3 blank | 0 comment | 2 complexity | ab7db890a30dafeeecd3162a251cd51a MD5 | raw file
 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 class TransparentLimitsPalette : DecoratorPaletteBase
10	{
11		public TransparentLimitsPalette() { }
12
13		public TransparentLimitsPalette(IPalette palette) : base(palette) { }
14
15		public override Color GetColor(double t)
16		{
17			if (t < 0 || t > 1) return Colors.Transparent;
18			return Palette.GetColor(t);
19		}
20	}
21}