anchor.diff:      context.fillRect(left, y, width - left, 1);
     }
   
  +  int get maxIterations => colors.length - 1;
  +
     num get radiusPixels => width < height ? width/2.0 : height/2.0;
     num scalePixel(num pix) => pix * radius / radiusPixels;
   
  -  num pixelToReal(int x) => scalePixel(x - width / 2) + center.real;
  -  num pixelToImag(int y) => -scalePixel(y - height / 2) + center.imag;
  +  num pixelToCoordX(int x) => scalePixel(x - width / 2) + center.real;
  +  num pixelToCoordY(int y) => -scalePixel(y - height / 2) + center.imag;
   }
   
   /// Returns the number of iterations it takes for the Mandelbrot sequence to
  
positive.code:     if (onClick != null) {
        convertOnClick = (HandlerEvent e) {
          MousePosition m = e.value;
          onClick(new Complex(pixelToReal(m.x), pixelToImag(m.y)));
        };
      }
  
  
negative.code:   }
  }
  
  class Color {
    final int h; // 0 - 360 (wraps)
    final num s; // 0 - 100
    final num l; // 0 - 100
    const Color.hsl(this.h, this.s, this.l);
    String toCss() => "hsl(${h%360},$s%,$l%)";
  }
  
  List<Color> colorRange(Color start, Color end, int size) {
    var interpolate = (int start, int end, num scale) =>
        ((end - start) * scale + start).round();
  
    var result = new List<Color>();
  
    for (double i = 0.0; i < size; i++) {
      num scale = i / (size - 1);
      int h = interpolate(start.h, end.h, scale) % 360;
      int s = interpolate(start.s, end.s, scale);
      int l = interpolate(start.l, end.l, scale);
      result.add(new Color.hsl(h, s, l));
    }
  
    return result;
  }
  
  typedef ClickHandler(Complex point);
  
  class MandelbrotView extends AnimatedTag implements Cloneable {
    final Complex center;
    final num radius;
  
    final int width;
    final int height;
    final List<Color> colors;
    final ClickHandler onClick;
  
    const MandelbrotView({
      this.center: const Complex(0, 0),
      this.radius: 2.0,
  
      this.width: 400,
      this.height: 400,
      this.colors,
      this.onClick
    });
  
  