-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColor.cpp
More file actions
75 lines (61 loc) · 1.02 KB
/
Copy pathColor.cpp
File metadata and controls
75 lines (61 loc) · 1.02 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
72
73
74
75
#include"stdafx.h"
#include"Color.h"
float Color::r(){ return red; }
float Color::g(){ return green; }
float Color::b(){ return blue; }
void Color:: initColors(float r, float g, float b)
{
if (r > 1.0f)
r = 1.0f;
if (g > 1.0f)
g = 1.0f;
if (b > 1.0f)
b = 1.0f;
red = r;
green = g;
blue = b;
}
Color::Color(float r, float g, float b)
{
if (r > 1.0f)
r = 1.0f;
if (g > 1.0f)
g = 1.0f;
if (b > 1.0f)
b = 1.0f;
red = r;
green = g;
blue = b;
}
Color Color::Grass()
{
return Color(0.34f, 0.6f, 0.31f);
}
Color Color::Snow()
{
return Color(1.0f, 1.0f, 1.0f);
}
Color Color::Water()
{
return Color(0.27f, 0.51f, 0.59f);
}
Color Color::Sky()
{
return Color(0.75f, 0.83f, 0.89f);
}
Color Color::Sand()
{
return Color(0.91f, 0.81f, 0.70f);
}
Color Color::Dirt()
{
return Color(0.68f, 0.46f, 0.24f);
}
Color Color::DarkSand()
{
return Color(0.58f, 0.51f, 0.27f);
}
Color Color::DarkSnow()
{
return Color(0.8f, 0.8f, 0.9f);
}