private void writeColor(@NotNull Element colorElements, @NotNull ColorKey key) {
    EditorColorsScheme baseScheme = getBaseScheme();
    Color color = colorMap.get(key);
    if (color == INHERITED_COLOR_MARKER) {
      ColorKey fallbackKey = key.getFallbackColorKey();
      Color parentFallback = baseScheme instanceof AbstractColorsScheme ?
                             ((AbstractColorsScheme)baseScheme).getDirectlyDefinedColor(key) : null;
      boolean parentOverwritingInheritance = parentFallback != null && parentFallback != INHERITED_COLOR_MARKER;
      if (fallbackKey != null && parentOverwritingInheritance) {
        colorElements.addContent(new Element(OPTION_ELEMENT)
                                   .setAttribute(NAME_ATTR, key.getExternalName())
                                   .setAttribute(BASE_ATTRIBUTES_ATTR, fallbackKey.getExternalName()));
      }
      return;
    }

    if (baseScheme != null) {
      Color parent = baseScheme instanceof AbstractColorsScheme
                     ? ((AbstractColorsScheme)baseScheme).getDirectlyDefinedColor(key)
                     : baseScheme.getColor(key);
      if (parent != null && colorsEqual(color, parent)) {
        return;
      }
    }

    String rgb = "";
    if (color != NULL_COLOR_MARKER) {
      rgb = Integer.toString(0xFFFFFF & color.getRGB(), 16);
      int alpha = 0xFF & color.getAlpha();
      if (alpha != 0xFF) {
        rgb += Integer.toString(alpha, 16);
      }
    }
    JdomKt.addOptionTag(colorElements, key.getExternalName(), rgb);
  }
private void writeColor(@NotNull Element colorElements, @NotNull ColorKey key)