-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathColorSet.cs
75 lines (73 loc) · 2.14 KB
/
ColorSet.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharpDX;
using SharpDX.Toolkit;
namespace Project1
{
using SharpDX.Toolkit.Graphics;
using SharpDX.Toolkit.Input;
class ColorSet
{
private float baseline;
public void setBaseline(float baseline)
{
this.baseline = baseline;
}
public Color GetColor(Vector3 pos)
{
float c = pos.Y;
{
if (c < baseline - 0.2)
{
return new Color(39, 64, 139); // RoyalBlue4
}
else if (c < baseline - 0.15)
{
return new Color(58, 95, 205); // RoyalBlue3
}
else if (c < baseline - 0.1)
{
return new Color(67, 110, 238); // RoyalBlue2
}
else if (c < baseline - 0.05)
{
return new Color(72, 118, 255); // RoyalBlue1
}
else if (c < baseline)
{
return new Color(69, 139, 0); //Green4
}
else if (c < baseline + 0.05)
{
return new Color(102, 205, 0); //Green3
}
else if (c < baseline + 0.1)
{
return new Color(118, 238, 0); //Green2
}
else if (c < baseline + 0.15)
{
return new Color(118, 238, 0); //Green1
}
else if (c < baseline + 0.2)
{
return new Color(139, 137, 137); //Snow4
}
else if (c < baseline + 0.25)
{
return new Color(205, 201, 201); //Snow3
}
else if (c < baseline + 0.3)
{
return new Color(238, 233, 233); //Snow2
}
else
{
return new Color(255, 250, 250); //Snow1
}
}
}
}
}