Black&white color-coding that ignores the relative distance. The Mandelbrot set is black, everything else is white. >>> get_black_and_white_rgb(0) (255, 255, 255) >>> get_black_and_white_rgb(0.5) (255, 255, 255) >>> get_black_and_white_rgb(1) (0, 0, 0)
(distance: float)
| 48 | |
| 49 | |
| 50 | def get_black_and_white_rgb(distance: float) -> tuple: |
| 51 | """ |
| 52 | Black&white color-coding that ignores the relative distance. The Mandelbrot |
| 53 | set is black, everything else is white. |
| 54 | |
| 55 | >>> get_black_and_white_rgb(0) |
| 56 | (255, 255, 255) |
| 57 | >>> get_black_and_white_rgb(0.5) |
| 58 | (255, 255, 255) |
| 59 | >>> get_black_and_white_rgb(1) |
| 60 | (0, 0, 0) |
| 61 | """ |
| 62 | if distance == 1: |
| 63 | return (0, 0, 0) |
| 64 | else: |
| 65 | return (255, 255, 255) |
| 66 | |
| 67 | |
| 68 | def get_color_coded_rgb(distance: float) -> tuple: |