code: final void attachShapeToColorMap(final Shape<?> shape)
      {
          if (null != shape)
          {
              String color = shape.getColorKey();
  
              if (null != color)
              {
                  m_shape_color_map.remove(color);
  
                  shape.setColorKey(null);
              }
              int count = 0;
  
              do
              {
                  count++;
  
                  color = m_c_rotor.next();
              }
              while ((m_shape_color_map.get(color) != null) && (count <= ColorKeyRotor.COLOR_SPACE_MAXIMUM));
  
              if (count > ColorKeyRotor.COLOR_SPACE_MAXIMUM)
              {
                  throw new IllegalArgumentException("Exhausted color space " + count);
              }
              m_shape_color_map.put(color, shape);
  
              shape.setColorKey(color);
          }
      }
docs: Internal method. Attach a Shape to the Layers Color Map