~shockham/cligen

9cb0c635075257cbe07febe4baf0bd216a0a0292 — shockham 1 year, 23 days ago 80744d0
neater colour calculation
1 files changed, 1 insertions(+), 13 deletions(-)

M march.c
M march.c => march.c +1 -13
@@ 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 ");
                }