/**
   * Creates a theme with custom colors.
   *
   * @param name the name of this theme
   * @param controlColor the background color for buttons, labels etc.
   * @param primaryControlColor the color of scrollbar "knobs"
   * @param backgroundColor the background color for viewports, tree's, tables etc.
   * @param textColor the text color
   * @param selectedBackgroundColor the background color for selected text, selected menu items
   * @param selectedTextColor the text color for selected text, selected menu items
   * @param shadingFactor the shading factor is used when calculating brighter and darker control
   *     colors. A higher factor gives brighter and darker colors.
   */
  public InfoNodeLookAndFeelTheme(
      String name,
      Color controlColor,
      Color primaryControlColor,
      Color backgroundColor,
      Color textColor,
      Color selectedBackgroundColor,
      Color selectedTextColor,
      double shadingFactor) {
    this.name = name;
    String[] fontNames =
        GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();

    for (int i = 0; i < FONT_NAMES.length; i++) {
      if (ArrayUtil.containsEqual(fontNames, FONT_NAMES[i])) {
        font = new FontUIResource(new Font(FONT_NAMES[i], Font.PLAIN, DEFAULT_FONT_SIZE));
        break;
      }
    }

    updateFonts();

    this.controlColor.setColor(controlColor);
    this.primaryControlColor.setColor(primaryControlColor);
    this.backgroundColor.setColor(backgroundColor);
    this.selectedTextBackgroundColor.setColor(selectedBackgroundColor);
    this.selectedTextColor.setColor(selectedTextColor);
    this.textColor.setColor(textColor);
    this.shadingFactor = shadingFactor;
    updateColors();
  }
 private static Font findFont(String name) {
   for (Font font : GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts()) {
     if (font.getName().equals(name)) {
       return font;
     }
   }
   return null;
 }