Color Cycling on the Mandelbrot Set

Within past 25 years, personal computers moved from being able to display text (regular, blinking and underlined) to the contemporary celebration of desktop graphics with streaming video. The first - black and white (BW) - graphic adapters have been followed by CGA (4-color graphics), EGA (16-colors), VGA (256), SVGA, and more. For me, as for many others, the graphic adapter brought an ability to generate and observe the mathematical wonder of the Mandelbrot set. Even in black and white and low resolution, the image held inexpressible fascination for mathematics and computer buffs.

I have no recollection worth being stored in my memory related to the introduction of the CGA. The EGA was a completely different matter. It was a technological quantum leap compared to 2- and 4-color graphics. Not only there were 16 colors to draw with, the colors had not been fixed. Instead, the adapter featured 16 color registers, each of which could hold - if the memory serves - an 8-bit color. To draw a figure of a given color, a programmer would assign that color to one of the registers and specify that register when drawing the figure. Once the figure was drawn, it was a simple matter to change its color without changing a single pixel on the display. All it took was assigning a different color to the register the figure had been drawn with. The change was instantaneous. One immediate application of this technology was the color cycling, which, in particular, transformed the Mandelbrot set from the realm of mystery into an object of beauty.

The exterior of the Mandelbrot set consists of points for which certain iterations diverge. Depending on how soon the divergence has been detected for a particular pixel, the pixel is assigned a register. After the picture has been drawn, one swaps the colors in the 16 registers in a cycling manner. The effect has been spectacular.

The first Java implementation did not have a facility to emulate color cycling, although it was able to utilize graphic adapters far more sophisticated than the hopelessly obsolete EGA. However, the new versions of Java did support that feature, which I was only too glad to exploit. The applet below does nothing but shows what the color cycling is about. (The applet requires Java 2, jre 1.4.2.)


If you are reading this, your browser is not set to run Java applets. Try IE11 or Safari and declare the site https://www.cut-the-knot.org as trusted in the Java setup.

Color Cycling on the Mandelbrot Set


What if applet does not run?

Pure magic.

Related material
Read more...

  • An Arithmetic Magic Trick
  • Bachet's Magic Trick
  • Gergonne's Magic Trick
  • Hummer's Mind Reader
  • Magic in Square
  • Math Telepathy
  • Number Guessing Game. All by Computer
  • Barcode Magic
  • Arithmetic magic matrix
  • Calendar Magic: an Interactive Gizmo
  • Two Numbers Guessing Game
  • |Contact| |Front page| |Contents| |Algebra|

    Copyright © 1996-2018 Alexander Bogomolny

    71471380