boolean (UElement element) { if (element instanceof UCallExpression callExpression && callExpression.getKind() == UastCallKind.CONSTRUCTOR_CALL) { final PsiClass psiClass = PsiTypesUtil.getPsiClass(callExpression.getReturnType()); return psiClass != null && JBColor.class.getName().equals(psiClass.getQualifiedName()); } return false; }