001package conexp.fx.gui.util;
002
003/*
004 * #%L
005 * Concept Explorer FX
006 * %%
007 * Copyright (C) 2010 - 2023 Francesco Kriegel
008 * %%
009 * This program is free software: you can redistribute it and/or modify
010 * it under the terms of the GNU General Public License as
011 * published by the Free Software Foundation, either version 3 of the
012 * License, or (at your option) any later version.
013 * 
014 * This program is distributed in the hope that it will be useful,
015 * but WITHOUT ANY WARRANTY; without even the implied warranty of
016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
017 * GNU General Public License for more details.
018 * 
019 * You should have received a copy of the GNU General Public
020 * License along with this program.  If not, see
021 * <http://www.gnu.org/licenses/gpl-3.0.html>.
022 * #L%
023 */
024
025
026import java.util.ArrayList;
027import java.util.Collections;
028import java.util.LinkedList;
029import java.util.List;
030
031import javafx.scene.paint.Color;
032
033public final class ColorScheme {
034
035  public static final ColorScheme        BASIC                 = new ColorScheme(
036                                                                   "Basic",
037                                                                   Color.BLUE,
038                                                                   Color.GREEN,
039                                                                   Color.ALICEBLUE,
040                                                                   Color.GREENYELLOW,
041                                                                   Color.RED);
042  public static final ColorScheme        TUD                   = new ColorScheme("TU Dresden", Colors.TUD_DARKBLUE,
043                                                               // Colors.TUD_LIGHTBLUE,
044                                                                   Colors.TUD_BLUE,
045                                                                   Colors.TUD_EXTRALIGHTBLUE,
046                                                                   Color.rgb(250, 120, 48),
047                                                                   Color.rgb(165, 74, 28));
048  public static final ColorScheme        JAVA_FX               = new ColorScheme(
049                                                                   "JavaFX",
050                                                                   Color.rgb(0, 100, 172),
051                                                                   Color.rgb(44, 44, 44),
052                                                                   Color.rgb(236, 236, 236),
053                                                                   Color.rgb(56, 166, 246),
054                                                                   Color.rgb(100, 100, 100));
055  public static final ColorScheme        WINDOWS_8             = new ColorScheme(
056                                                                   "Windows 8",
057                                                                   Color.rgb(25, 121, 202),
058                                                                   Color.rgb(41, 140, 225),
059                                                                   Color.rgb(235, 235, 235),
060                                                                   Color.rgb(0, 204, 255),
061                                                                   Color.rgb(224, 67, 67));
062  public static final ColorScheme        WATERLIME             = new ColorScheme(
063                                                                   "Waterlime",
064                                                                   Color.rgb(92, 138, 45),
065                                                                   Color.rgb(0, 195, 169),
066                                                                   Color.rgb(255, 255, 255),
067                                                                   Color.rgb(175, 214, 135),
068                                                                   Color.rgb(0, 135, 152));
069  public static final ColorScheme        SALMON_ON_ICE         = new ColorScheme(
070                                                                   "Salmon on Ice",
071                                                                   Color.rgb(62, 69, 76),
072                                                                   Color.rgb(33, 133, 197),
073                                                                   Color.rgb(255, 246, 229),
074                                                                   Color.rgb(126, 206, 253),
075                                                                   Color.rgb(255, 127, 102));
076  public static final ColorScheme        DEFAULT               = WINDOWS_8;
077  private static final List<ColorScheme> availableColorSchemes = Collections
078                                                                   .synchronizedList(new LinkedList<ColorScheme>());
079  static {
080    availableColorSchemes.add(BASIC);
081    availableColorSchemes.add(TUD);
082    availableColorSchemes.add(JAVA_FX);
083    availableColorSchemes.add(WINDOWS_8);
084    availableColorSchemes.add(WATERLIME);
085    availableColorSchemes.add(SALMON_ON_ICE);
086  }
087
088  public static final List<ColorScheme> getAvailableColorSchemes() {
089    return availableColorSchemes;
090  }
091
092  private final String      name;
093  private final List<Color> colors = new ArrayList<Color>(5);
094
095  public ColorScheme(
096      final String name,
097      final Color color1,
098      final Color color2,
099      final Color color3,
100      final Color color4,
101      final Color color5) {
102    this.name = name;
103    colors.add(color1);
104    colors.add(color2);
105    colors.add(color3);
106    colors.add(color4);
107    colors.add(color5);
108  }
109
110  public final String getName() {
111    return name;
112  }
113
114  public final Color getColor(final int index) {
115    if (index < 1 || index > 5)
116      return null;
117    return colors.get(index - 1);
118  }
119}