38{
39
40 cout << "\n\n\n==========================================================\n";
41 cout << "Testing the PColor Class\n";
42 cout << "==========================================================\n";
43
44 cout << "Constructing Colors\n";
54
55
56
57 cout << "==========================================================\n";
58 cout << "Printing Colors\n";
59 cout << myColor1 << endl;
60 cout << myColor2 << endl;
61 cout << myColor3 << endl;
62 cout << myColor4 << endl;
63 cout << myColor5 << endl;
64 cout << myColor6 << endl;
65 cout << myColor7 << endl;
66 cout << myColor8 << endl;
67 cout << myColor9 << endl;
68
69
70 cout << "==========================================================\n";
71 cout << "Printing Integer Colors\n";
72 cout <<
"myColor1: " << myColor1 <<
"|" << myColor1.
GetColor() << endl;
73 cout <<
"myColor2: " << myColor2 <<
"|" << myColor2.
GetColor() << endl;
74 cout <<
"myColor3: " << myColor3 <<
"|" << myColor3.
GetColor() << endl;
75 cout <<
"myColor4: " << myColor4 <<
"|" << myColor4.
GetColor() << endl;
76 cout <<
"myColor5: " << myColor5 <<
"|" << myColor5.
GetColor() << endl;
77 cout <<
"myColor6: " << myColor6 <<
"|" << myColor6.
GetColor() << endl;
78 cout <<
"myColor7: " << myColor7 <<
"|" << myColor7.
GetColor() << endl;
79 cout <<
"myColor8: " << myColor8 <<
"|" << myColor8.
GetColor() << endl;
80 cout <<
"myColor9: " << myColor9 <<
"|" << myColor9.
GetColor() << endl;
81
82
83
84 cout << "==========================================================\n";
85 cout << "Changing color of: " << myColor1 << endl;;
90
91 cout << "to: " << myColor1 << endl;
92
93
94 cout << "==========================================================\n";
95 cout << "Getting specific colors of " << myColor1 << endl;
96 cout <<
"Red: " << myColor1.
GetRed() <<endl;
97 cout <<
"Green: " << myColor1.
GetGreen()<<endl;
98 cout <<
"Blue: " << myColor1.
GetBlue()<<endl;
99 cout <<
"Alpha: " << myColor1.
GetAlpha()<<endl;
100 cout <<endl;
101
102
103
104
105 cout << "==========================================================\n";
106 cout << "Changing color of: " << myColor1 << endl;;
111
112 cout << "to: " << myColor1 << endl;
113
114
115 cout << "==========================================================\n";
116 cout << "Getting specific colors of " << myColor1 << endl;
117 cout <<
"Red: " << myColor1.
GetRed() <<endl;
118 cout <<
"Green: " << myColor1.
GetGreen()<<endl;
119 cout <<
"Blue: " << myColor1.
GetBlue()<<endl;
120 cout <<
"Alpha: " << myColor1.
GetAlpha()<<endl;
121 cout <<endl;
122
123
124
125
126 cout << "==========================================================\n";
127 cout << "Changing color of: " << myColor1 << endl;;
129
130
131 cout << "to: " << myColor1 << endl;
132
133
134 cout << "==========================================================\n";
135 cout << "Getting specific colors of " << myColor1 << endl;
136 cout <<
"Red: " << myColor1.
GetRed() <<endl;
137 cout <<
"Green: " << myColor1.
GetGreen()<<endl;
138 cout <<
"Blue: " << myColor1.
GetBlue()<<endl;
139 cout <<
"Alpha: " << myColor1.
GetAlpha()<<endl;
140 cout <<endl;
141
142
143
144
145 cout << "==========================================================\n";
146 cout << "Changing color of: " << myColor1 << endl;;
148 cout << "to: " << myColor1 << endl;
149
150
151 cout << "==========================================================\n";
152 cout << "Getting specific colors of " << myColor1 << endl;
153 cout <<
"Red: " << myColor1.
GetRed() <<endl;
154 cout <<
"Green: " << myColor1.
GetGreen()<<endl;
155 cout <<
"Blue: " << myColor1.
GetBlue()<<endl;
156 cout <<
"Alpha: " << myColor1.
GetAlpha()<<endl;
157 cout <<endl;
158
159
160 cout << "==========================================================\n";
161 cout << "Changing color of: " << myColor1 << endl;;
163 cout << "to: " << myColor1 << endl;
164
165
166 cout << "==========================================================\n";
167 cout << "Getting specific colors of " << myColor1 << endl;
168 cout <<
"Red: " << myColor1.
GetRed() <<endl;
169 cout <<
"Green: " << myColor1.
GetGreen()<<endl;
170 cout <<
"Blue: " << myColor1.
GetBlue()<<endl;
171 cout <<
"Alpha: " << myColor1.
GetAlpha()<<endl;
172 cout <<endl;
173
174
175 cout << "Finished" << endl;
176 return 0;
177}
void SetColorByName(const std::string &colorname)
Sets color as by its name.
unsigned int GetColor() const
Gets 32-bit unsigned int color.
void SetColorByRGBA(unsigned int color)
Sets color as a 32-bit unsigned int.