code: public int getColorByLayer( DwgObject entity ) {
          int colorByLayer = 0;
          int layer = entity.getLayerHandle();
          for( int j = 0; j < layerTable.size(); j++ ) {
              Vector layerTableRecord = (Vector) layerTable.get(j);
              int lHandle = ((Integer) layerTableRecord.get(0)).intValue();
              if (lHandle == layer) {
                  colorByLayer = ((Integer) layerTableRecord.get(2)).intValue();
              }
          }
          return colorByLayer;
      }
docs: Returns the color of the layer of a DWG object
  
  @param entity DWG object which we want to know its layer color
  @return int Layer color of the DWG object in the Autocad color code