-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColor.cpp
More file actions
71 lines (61 loc) · 1.38 KB
/
Copy pathColor.cpp
File metadata and controls
71 lines (61 loc) · 1.38 KB
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
#include "../headers/Color.h"
unsigned char base(int rgb, int d){
unsigned char res;
switch (rgb)
{
case 0:
res = (unsigned char)(30 + 20*d);
break;
case 1:
res = (unsigned char)(30 + 20*d);
break;
case 2:
res = (unsigned char)(30 + 20*d);
break;
default:
std::cerr << "Not expected value given" << std::endl;
res = 0;
break;
}
return res;
}
unsigned char blue_green_blue(int rgb, int d){
unsigned char res;
switch (rgb)
{
case 0:
res = (unsigned char)(95);
break;
case 1:
res = (unsigned char)((-1*abs(d-500))/2+255);
break;
case 2:
res = (unsigned char)(150);
break;
default:
std::cerr << "Not expected value given" << std::endl;
res = 0;
break;
}
return res;
}
unsigned char experience(int rgb, int d){
unsigned char res;
switch (rgb)
{
case 0:
res = (unsigned char)(-1*(d*22));
break;
case 1:
res = (unsigned char)(1*(abs(d-500))/2+255);
break;
case 2:
res = (unsigned char)(75 + 20*d); // 150 de base
break;
default:
std::cerr << "Not expected value given" << std::endl;
res = 0;
break;
}
return res;
}