public static @Nullable RelativePoint bestLocationForColorPickerPopup(@Nullable Editor editor) {
    if (editor == null || editor.isDisposed()) {
      return null;
    }
    AWTEvent event = IdeEventQueue.getInstance().getTrueCurrentEvent();
    if (event instanceof MouseEvent) {
      Component component = ((MouseEvent)event).getComponent();
      Component clickComponent = SwingUtilities.getDeepestComponentAt(component, ((MouseEvent)event).getX(), ((MouseEvent)event).getY());
      if (clickComponent instanceof EditorGutter) {
        return null;
      }
    }
    VisualPosition visualPosition = editor.getCaretModel().getCurrentCaret().getVisualPosition();
    Point pointInEditor = editor.visualPositionToXY(new VisualPosition(visualPosition.line + 1, visualPosition.column));
    return new RelativePoint(editor.getContentComponent(),pointInEditor);
  }
public static @Nullable RelativePoint bestLocationForColorPickerPopup(@Nullable Editor editor)