From c94f4b2bc1d211cdece33b1e200d8e98605a1730 Mon Sep 17 00:00:00 2001 From: Tanner Robison Date: Mon, 24 Aug 2026 16:48:53 -0700 Subject: changed to nicer colors --- mandelbrot_set | Bin 16848 -> 20944 bytes mandelbrot_set.c | 35 ++++++++++++++++++++++++----------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/mandelbrot_set b/mandelbrot_set index 444b3e7..d6ee560 100755 Binary files a/mandelbrot_set and b/mandelbrot_set differ diff --git a/mandelbrot_set.c b/mandelbrot_set.c index 32c38bc..cec552f 100644 --- a/mandelbrot_set.c +++ b/mandelbrot_set.c @@ -62,10 +62,10 @@ int main(void) start_color(); use_default_colors(); // keeps terminal background color - // gradient pairs - init_pair(1, COLOR_BLUE, COLOR_BLACK); - init_pair(2, COLOR_CYAN, COLOR_BLACK); - init_pair(3, COLOR_WHITE, COLOR_BLACK); + // Galactic Void Theme (Pairs 14, 15, & 16) + init_pair(1, COLOR_CYAN, COLOR_BLACK); + init_pair(2, COLOR_BLUE, COLOR_BLACK); + init_pair(3, COLOR_MAGENTA, COLOR_BLACK); } cbreak(); @@ -234,24 +234,37 @@ static void draw_mandelbrot(const struct viewer *viewer) iteration, viewer->max_iterations); int color_pair = 0; + bool is_bold = false; if (iteration < viewer->max_iterations) { // Group iterations into bands of 8 for a smooth // ripple effect int band = (iteration / 8) % 3; - if (band == 0) + if (band == 0) { color_pair = 1; // Deep Blue - else if (band == 1) + is_bold = true; + } else if (band == 1) { color_pair = 2; // Bright Cyan - else + } else if (band == 2) { color_pair = 3; // White highlight + } } // Apply color, draw pixel, remove color - if (color_pair > 0) - attron(COLOR_PAIR(color_pair)); + if (color_pair > 0) { + attron(COLOR_PAIR(color_pair) | A_BOLD); + if (is_bold) { + attron(A_BOLD); + } + } + mvaddch(screen_y, screen_x, pixel); - if (color_pair > 0) - attroff(COLOR_PAIR(color_pair)); + + if (color_pair > 0) { + attroff(COLOR_PAIR(color_pair) | A_BOLD); + if (is_bold) { + attroff(A_BOLD); + } + } } } -- cgit v1.2.3