Color (String colorText) { final PsiFile file = myLiteral.getContainingFile(); if (!(file instanceof JsonFile)) return null; final List<JsonProperty> colors = ThemeJsonUtil.getNamedColors((JsonFile)file); final JsonProperty namedColor = ContainerUtil.find(colors, property -> property.getName().equals(colorText)); if (namedColor == null) return null; final JsonValue value = namedColor.getValue(); if (!(value instanceof JsonStringLiteral)) return null; return parseColor(((JsonStringLiteral)value).getValue()); }