private Color juliaColor(int x, int y)
    {
        double zA = left + x * horizontalIncrement; //real component of z
        double zB = top + y * verticalIncrement;    //imaginary component of z
        double smoothColor = Math.exp(-Math.sqrt(zA * zA + zB * zB));
        for(int i = 0; i < itr; i++)
        {
            double zATemp = (zA * zA - zB * zB) + cA; //z = z^2 + c
            zB = (2 * zA * zB) + cB;
            zA = zATemp;
            smoothColor += Math.exp(-Math.sqrt(zA * zA + zB * zB));
            if(zA * zA + zB * zB > 4.0)
            {
//                return new Color(0x000080 + 0x080400 * i); //bands of color
                //the following two extra iterations reduce the
                //size of the "error term" (they make the fractal
                //smoother)
                zATemp = (zA * zA - zB * zB) + cA; //z = z^2 + c
                zB = (2 * zA * zB) + cB;
                zA = zATemp;
                smoothColor += Math.exp(-Math.sqrt(zA * zA + zB * zB));
                zATemp = (zA * zA - zB * zB) + cA; //z = z^2 + c
                zB = (2 * zA * zB) + cB;
                zA = zATemp;
                smoothColor += Math.exp(-Math.sqrt(zA * zA + zB * zB));
                return Color.getHSBColor(.6f + 10f * (float)smoothColor/itr,.6f,1);

            }
        }
        return Color.black;
    }