/**
   * Returns the color scheme to be used for painting the specified visual area of the component
   * under the specified component state.
   *
   * @param comp Component.
   * @param associationKind Color scheme association kind.
   * @param componentState Component state.
   * @return Color scheme to be used for painting the specified visual area of the component under
   *     the specified component state.
   * @see #registerColorScheme(SubstanceColorScheme, ComponentState...)
   * @since version 5.1
   */
  public SubstanceColorScheme getColorScheme(
      ColorSchemeAssociationKind associationKind, ComponentState componentState) {
    if (associationKind == ColorSchemeAssociationKind.FILL)
      return this.getColorScheme(componentState);

    SubstanceColorScheme registered = this.colorSchemeMap.get(associationKind).get(componentState);
    if (registered != null) return registered;

    // if (componentState.isActive()) {
    // for now look for the best fit only on active states
    Map<ComponentState, ComponentState> bestFitForState = this.bestFillMap.get(associationKind);
    if (!bestFitForState.containsKey(componentState)) {
      Collection<ComponentState> registeredStates =
          this.colorSchemeMap.get(associationKind).keySet();
      bestFitForState.put(componentState, componentState.bestFit(registeredStates));
    }
    ComponentState bestFit = bestFitForState.get(componentState);
    if (bestFit != null) {
      registered = this.colorSchemeMap.get(associationKind).get(bestFit);
      if (registered != null) return registered;
    }
    // }

    ColorSchemeAssociationKind fallback = associationKind.getFallback();
    if (fallback == null) return null;

    return getColorScheme(fallback, componentState);
  }
  /**
   * Creates a new color scheme bundle.
   *
   * @param activeColorScheme The active color scheme of this bundle.
   * @param enabledColorScheme The enabled color scheme of this bundle.
   * @param disabledColorScheme The disabled color scheme of this bundle.
   */
  public SubstanceColorSchemeBundle(
      SubstanceColorScheme activeColorScheme,
      SubstanceColorScheme enabledColorScheme,
      SubstanceColorScheme disabledColorScheme) {
    this.activeColorScheme = activeColorScheme;
    this.enabledColorScheme = enabledColorScheme;
    this.disabledColorScheme = disabledColorScheme;
    this.stateAlphaMap = new HashMap<ComponentState, Float>();
    // ComponentState.class);
    this.stateHighlightSchemeAlphaMap = new HashMap<ComponentState, Float>();
    // ComponentState.class);

    this.colorSchemeMap =
        new HashMap<ColorSchemeAssociationKind, Map<ComponentState, SubstanceColorScheme>>();
    for (ColorSchemeAssociationKind associationKind : ColorSchemeAssociationKind.values()) {
      this.colorSchemeMap.put(associationKind, new HashMap<ComponentState, SubstanceColorScheme>());
    }

    this.bestFillMap =
        new HashMap<ColorSchemeAssociationKind, Map<ComponentState, ComponentState>>();
    for (ColorSchemeAssociationKind associationKind : ColorSchemeAssociationKind.values()) {
      this.bestFillMap.put(associationKind, new HashMap<ComponentState, ComponentState>());
    }
  }