private static Color @NotNull [] generateColors(@NotNull TextAttributesScheme colorsScheme) {
    List<Color> stopRainbowColors =
      ContainerUtil.map(RAINBOW_COLOR_KEYS, key -> getRainbowColorFromAttribute(colorsScheme.getAttributes(key)));
    List<Color> rainbowColors = ColorGenerator.generateLinearColorSequence(stopRainbowColors, RAINBOW_COLORS_BETWEEN);

    if (colorsScheme instanceof EditorColorsScheme) {
      EditorColorPalette palette = EditorColorPaletteFactory
        .getInstance()
        .getPalette((EditorColorsScheme)colorsScheme, Language.ANY)
        .collectColorsWithFilter(attr -> getRainbowColorFromAttribute(attr), true);


      List<Pair<Color, Double>> colorCircles = new ArrayList<>();
      Color background = ((EditorColorsScheme)colorsScheme).getDefaultBackground();
      boolean schemeIsDark = ColorUtil.isDark(background);
      double minDistanceWithOrdinal = schemeIsDark ? 0.06 : 0.10;
      double minDistanceWithDiagnostic = schemeIsDark ? 0.12 : 0.20;
      colorCircles.add(Pair.create(background, 0.24));
      
      palette.getEntries().forEach(entry -> colorCircles.add(Pair.create(entry.getKey(),
                                                                         Collections.disjoint(CODE_INSIGHT_CONFLICT_KEYS, entry.getValue())
                                                                         ? minDistanceWithOrdinal
                                                                         : minDistanceWithDiagnostic)));
      rainbowColors = ContainerUtil.map(rainbowColors, rainbowColor -> resolveConflict(colorCircles, rainbowColor, 0));
      for (int i = 0; i < RAINBOW_TEMP_KEYS.length; i++) {
        TextAttributesKey key = RAINBOW_TEMP_KEYS[i];
        TextAttributes attributes = createRainbowAttribute(rainbowColors.get(i));
        ((EditorColorsScheme)colorsScheme).setAttributes(key, attributes);
      }
    }
    return rainbowColors.toArray(new Color[0]);
  }
private static Color @NotNull [] generateColors(@NotNull TextAttributesScheme colorsScheme)