aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 2cd66a9..8049bac 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,5 +1,8 @@
#include <iostream>
+#include "color.hpp"
+#include "vec3.hpp"
+
int main() {
size_t width = 256;
size_t height = 256;
@@ -22,12 +25,8 @@ int main() {
auto r = double(column) / (width-1);
auto g = double(row) / (height-1);
auto b = 0.25;
-
- int ir = static_cast<int>(255.999 * r);
- int ig = static_cast<int>(255.999 * g);
- int ib = static_cast<int>(255.999 * b);
-
- std::cout << ir << ' ' << ig << ' ' << ib << '\n';
+ color c(r, g, b);
+ write_color(std::cout, c);
}
}