Color (@Nullable PsiElement element, @Nullable UCallExpression newExpression) { if (newExpression != null && newExpression.getKind() == UastCallKind.CONSTRUCTOR_CALL && isColorType(newExpression.getReturnType())) { return getColor(newExpression.getValueArguments()); } if (isIntLiteralInsideNewJBColorExpression(element)) { final String text = element.getText(); boolean hasAlpha = text != null && StringUtil.startsWithIgnoreCase(text, "0x") && text.length() > 8; ULiteralExpression literal = UastContextKt.toUElement(element, ULiteralExpression.class); Object object = getObject(literal); if (object instanceof Integer) return new Color(((Integer)object).intValue(), hasAlpha); } return null; }