@@ 143,19 143,7 @@ int main(void)
out = traceRay(origin, direction);
// output
if (out.y >= 0.0f) {
- if (out.x < 2) {
- printf("\033[48;5;46m ");
- } else if (out.x < 3) {
- printf("\033[48;5;82m ");
- } else if (out.x < 4) {
- printf("\033[48;5;118m ");
- } else if (out.x < 5) {
- printf("\033[48;5;154m ");
- } else if (out.x < 10) {
- printf("\033[48;5;190m ");
- } else if (out.x < 16) {
- printf("\033[48;5;226m ");
- }
+ printf("\033[48;5;%dm ", 231 + (int)out.x);
} else {
printf("\033[48;5;0m ");
}