Color (@NotNull PsiElement element) { if (element.getFirstChild() != null) return null; if (element instanceof PsiWhiteSpace) return null; if (!myUastMetaLanguage.matchesLanguage(element.getLanguage())) return null; PsiElement parent = element.getParent(); UCallExpression newExpression = UastUtils.findContaining(parent, UCallExpression.class); Color color = getJavaColorFromExpression(parent, newExpression); if (color == null) { parent = parent == null ? null : parent.getParent(); color = getJavaColorFromExpression(parent); } if (newExpression != null && color != null) { UReferenceExpression uRef = newExpression.getClassReference(); String resolvedName = uRef == null ? null : uRef.getResolvedName(); if (resolvedName != null && element.textMatches(resolvedName)) { return color; } } if (isIntLiteralInsideNewJBColorExpression(parent)) { return color; } return null; }