Skip to content
Snippets Groups Projects
Commit 907fe5bc authored by Joakim Hunskaar's avatar Joakim Hunskaar
Browse files

removed comment and edited colormap

parent a86765f1
No related branches found
No related tags found
1 merge request!5Add lambda functions for the predefined colors
...@@ -20,7 +20,7 @@ struct Ball { ...@@ -20,7 +20,7 @@ struct Ball {
TDT4102::Color colour = TDT4102::Color::white; TDT4102::Color colour = TDT4102::Color::white;
}; };
std::map<std::string, const TDT4102::Color&> stringToColor { std::map<std::string, TDT4102::Color> stringToColor {
{"red", TDT4102::Color::red}, {"red", TDT4102::Color::red},
{"gold", TDT4102::Color::gold}, {"gold", TDT4102::Color::gold},
{"green", TDT4102::Color::green}, {"green", TDT4102::Color::green},
...@@ -83,7 +83,6 @@ int main(int argc, char* argv[]) { ...@@ -83,7 +83,6 @@ int main(int argc, char* argv[]) {
circles.at(i).ySpeed = float(randint(-400, 400)) / 100.0f; circles.at(i).ySpeed = float(randint(-400, 400)) / 100.0f;
// circles.at(i).colour = TDT4102::Color(randint(INT_MIN, INT_MAX) & 0xFFFFFF00); // circles.at(i).colour = TDT4102::Color(randint(INT_MIN, INT_MAX) & 0xFFFFFF00);
circles.at(i).colour = stringToColor.at(colors.at(randint(0, (colors.size()-1)))); circles.at(i).colour = stringToColor.at(colors.at(randint(0, (colors.size()-1))));
// circles.at(i).colour = TDT4102::Color::rebecca_purple;
} }
while (!window.should_close()) { while (!window.should_close()) {
if (window.is_key_down(KeyboardKey::A)) { if (window.is_key_down(KeyboardKey::A)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment