docs: private void computeRootStatistics(Area root)
      {
      	for (Box box : root.getBoxes())
      	{
      		int len = letterLength(box.getText());
      		if (len > 0)
      		{
      			int key = colorKey(box.getColor());
      			Integer val = colors.get(key);
      			if (val == null) val = 0;
      			val += len;
      			colors.put(key, val);
      		}
      	}
          for (int i = 0; i < root.getChildCount(); i++)
              computeRootStatistics(root.getChildAt(i));
      }
      
      private int letterLength(String s)
      {
          int len = 0;
          for (int i = 0; i < s.length(); i++)
              if (Character.getType(s.charAt(i)) != Character.SPACE_SEPARATOR)
                  len++;
          return len;
      }
  
      /**
       * Converts a color to a number, 4 bits per color channel so that similar colors have similar numbers.
       */
      private int colorKey(Color color)
      {
          return (color.getRed() / 16) * 256 + (color.getGreen() / 16) * 16 + (color.getBlue() / 16);
      }
  
  }