Skip to content

Commit 9896331

Browse files
committed
Remove white, unused. PNG has smaller colormap.
1 parent 08b958d commit 9896331

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

check_mandelbrot.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ START_TEST(test_some_known_points)
7474
size_t iterations = 100;
7575
complex double is_in_set = 0.0 + I * 0.0;
7676
complex double is_not_in_set = 1.5 + I * 1.5;
77-
ck_assert_int_eq(1, choose_escape_color(is_in_set, iterations));
78-
ck_assert_int_ne(1, choose_escape_color(is_not_in_set, iterations));
77+
ck_assert_int_eq(0, choose_escape_color(is_in_set, iterations));
78+
ck_assert_int_ne(0, choose_escape_color(is_not_in_set, iterations));
7979
}
8080
END_TEST
8181

mandelbrot.c

+5-6
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99

1010
#include "mandelbrot.h"
1111

12-
static const size_t NUM_COLORS = 5;
12+
static const size_t NUM_COLORS = 4;
1313
static int rgb_colors[NUM_COLORS][3] = {
14-
{ 255, 255, 255 },
1514
{ 0, 0, 0 },
1615
{ 176, 229, 247 },
1716
{ 245, 137, 169 },
@@ -133,13 +132,13 @@ choose_escape_color(complex double c, size_t maximum_iterations)
133132
escape = 0;
134133

135134
if (escape == 0)
136-
return 1;
135+
return 0;
137136
else if (escape <= (maximum_iterations / 7))
138-
return 2;
137+
return 1;
139138
else if (escape <= (maximum_iterations / 5))
140-
return 3;
139+
return 2;
141140
else
142-
return 4;
141+
return 3;
143142

144143
return escape;
145144
}

pngelbrot.png

-1.29 KB
Loading

0 commit comments

Comments
 (0)