@VisibleForTesting
  int determineSizeHintColor(int imageWidth, int imageHeight, @Nullable ScaleType scaleType) {
    int visibleDrawnAreaWidth = getBounds().width();
    int visibleDrawnAreaHeight = getBounds().height();

    if (visibleDrawnAreaWidth <= 0
        || visibleDrawnAreaHeight <= 0
        || imageWidth <= 0
        || imageHeight <= 0) {
      return TEXT_COLOR_IMAGE_NOT_OK;
    }

    if (scaleType != null) {
      // Apply optional scale type in order to get boundaries of the actual area to be filled
      mRect.left = mRect.top = 0;
      mRect.right = visibleDrawnAreaWidth;
      mRect.bottom = visibleDrawnAreaHeight;

      mMatrix.reset();

      // We can ignore the focus point as it has no influence on the scale, but only the translation
      scaleType.getTransform(mMatrix, mRect, imageWidth, imageHeight, 0f, 0f);

      mRectF.left = mRectF.top = 0;
      mRectF.right = imageWidth;
      mRectF.bottom = imageHeight;

      mMatrix.mapRect(mRectF);

      final int drawnAreaWidth = (int) mRectF.width();
      final int drawnAreaHeight = (int) mRectF.height();

      visibleDrawnAreaWidth = Math.min(visibleDrawnAreaWidth, drawnAreaWidth);
      visibleDrawnAreaHeight = Math.min(visibleDrawnAreaHeight, drawnAreaHeight);
    }

    // Update the thresholds for the overlay color
    float scaledImageWidthThresholdOk = visibleDrawnAreaWidth * IMAGE_SIZE_THRESHOLD_OK;
    float scaledImageWidthThresholdNotOk = visibleDrawnAreaWidth * IMAGE_SIZE_THRESHOLD_NOT_OK;
    float scaledImageHeightThresholdOk = visibleDrawnAreaHeight * IMAGE_SIZE_THRESHOLD_OK;
    float scaledImageHeightThresholdNotOk = visibleDrawnAreaHeight * IMAGE_SIZE_THRESHOLD_NOT_OK;

    // Calculate the dimension differences
    int absWidthDifference = Math.abs(imageWidth - visibleDrawnAreaWidth);
    int absHeightDifference = Math.abs(imageHeight - visibleDrawnAreaHeight);

    // Return corresponding color
    if (absWidthDifference < scaledImageWidthThresholdOk
        && absHeightDifference < scaledImageHeightThresholdOk) {
      return TEXT_COLOR_IMAGE_OK;
    } else if (absWidthDifference < scaledImageWidthThresholdNotOk
        && absHeightDifference < scaledImageHeightThresholdNotOk) {
      return TEXT_COLOR_IMAGE_ALMOST_OK;
    }
    return TEXT_COLOR_IMAGE_NOT_OK;
  }
Pass a semi-transparency color (e.g., 0x66RRGGBB) to give the overlay a color shade.
drawee/src/main/java/com/facebook/drawee/debug/DebugControllerOverlayDrawable.java