HtmlChunk (@Nls @NotNull String locationString) { Color color = ExperimentalUI.isNewUI() ? JBUI.CurrentTheme.ContextHelp.FOREGROUND : SimpleTextAttributes.GRAY_ATTRIBUTES.getFgColor(); return HtmlChunk.text(locationString). wrapWith("font").attr("color", "#" + ColorUtil.toHex(color)); }