-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDraw.cs
77 lines (58 loc) · 2.24 KB
/
Draw.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
76
77
using Microsoft.Xna.Framework;
using System;
namespace PasiveRadar
{
public class Draw
{
public const int ColorTableSize = 1024;
public static int LeftMargin = 30;
public static int RightMargin = 20;
public int BottomMargin = 40;
public int TopMargin = 20;
public int ColorThemeNr;
public Color[] ColorTable;
public Color[] CustomTable;
public Draw()
{
ColorTable = new Color[ColorTableSize];
CustomTable = new Color[ColorTableSize];
}
public void CreateColorTable1(int select, Color[] ColorThemeTable, Flags flags)
{
int i;
int alpha;
if (flags != null)
alpha = flags.alpha;
else
alpha = 255;
Array.Copy(ColorThemeTable, CustomTable, ColorTableSize);
switch (select)
{
case 0:
//Blue
for (i = 0; i < 512; i++)
ColorTable[i] = Color.FromNonPremultiplied(0, 0, i / 2, alpha);
//Purple
for (i = 0; i < 256; i++)
ColorTable[i + 512] = Color.FromNonPremultiplied(i, 0, 255, alpha);
//Red
for (i = 0; i < 256; i++)
ColorTable[i + 256 * 3] = Color.FromNonPremultiplied(255, 0, 255 - i, alpha);
break;
case 1:
//Green 512
for (i = 0; i < 512; i++)
ColorTable[i] = Color.FromNonPremultiplied(0, 0, i / 2, alpha);
//Yellow 512
for (i = 0; i < 512; i++)
ColorTable[i + 512] = Color.FromNonPremultiplied(i / 2, 255, 0, alpha);
break;
case 2: //User defined color
//Array.Copy(CustomTable, ColorTable, ColorTableSize);
for (i = 0; i < ColorTable.Length; i++)
ColorTable[i] = Color.FromNonPremultiplied(CustomTable[i].R, CustomTable[i].G, CustomTable[i].B, alpha);
break;
}
}
}
}