PageRenderTime 38ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
C# | 30 lines | 21 code | 2 blank | 7 comment | 0 complexity | f4ba0e4c773f61abcfb030d1232528e3 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows.Media;
  6. namespace Microsoft.Research.DynamicDataDisplay.Common.Palettes
  7. {
  8. /// <summary>
  9. /// Contains some predefined linear palettes.
  10. /// </summary>
  11. public static class LinearPalettes
  12. {
  13. private const double geoHeight = 8845 + 400;
  14. private static LinearPalette geoHeightsPalette = new LinearPalette(
  15. Color.FromRgb(1, 99, 69), Colors.White,
  16. new LinearPaletteColorStep(Color.FromRgb(28, 128, 52), (50 + 400) / geoHeight),
  17. new LinearPaletteColorStep(Color.FromRgb(229, 209, 119), (200 + 400) / geoHeight),
  18. new LinearPaletteColorStep(Color.FromRgb(160, 66, 1), (1000 + 400) / geoHeight),
  19. new LinearPaletteColorStep(Color.FromRgb(129, 32, 32), (2000 + 400) / geoHeight),
  20. new LinearPaletteColorStep(Color.FromRgb(119, 119, 119), (4000 + 400) / geoHeight),
  21. new LinearPaletteColorStep(Color.FromRgb(244, 244, 244), (6000 + 400) / geoHeight));
  22. /// <summary>
  23. /// Gets the palette for geo height map visualization.
  24. /// </summary>
  25. /// <value>The geo heights palette.</value>
  26. public static LinearPalette GeoHeightsPalette { get { return geoHeightsPalette; } }
  27. }
  28. }