@@ -0,0 +1,2748 @@
+/*%0A * HYPE_Processing%0A * http://www.hypeframework.org/ & https://github.com/hype/HYPE_Processing%0A * %0A * Copyright (c) 2013-2015 Joshua Davis%0A *  %0A * Distributed under the BSD License. See LICENSE.txt for details.%0A * %0A * All rights reserved.%0A *%0A * ----- *%0A * HGroupColorPool - class for HYPE by GD / @Garth_D*%0A * Tested using processing 3.0.1 (It may break on newer versions of processing) *%0A * If you find any issues or make anything cool with this, let me know on twitter at @Garth_D *%0A * %0A * Helper class for HYPE framework - creates a pool of HColorPools %0A * (Yes...pools within pools...I know. It's all a bit self referential)%0A *%0A * What's the point of this? Well, this is basically to help you explore different color schemes in HYPE%0A * it'll let you easily swap out and apply different HColorPools to a single HYPE sketch %0A * without having to restart and change your code each time%0A *%0A */%0A%0Apackage hype.extended.colorist;%0Aimport hype.H;%0Aimport java.util.ArrayList;%0A%0Apublic class HGroupColorPool %7B%0A  private int currentIndex=-1;%0A  private ArrayList%3CHColorPool%3E colorGroupList;%0A  public HGroupColorPool(HColorPool... colors) %7B%0A    colorGroupList = new ArrayList%3CHColorPool%3E();%0A    for (int i=0; i%3Ccolors.length; ++i) %0A      add(colors%5Bi%5D);%0A  %7D%0A%0A  private int setIndex(int i) %7B%0A    //ensure index within bounds%0A    if (i %3E= size() %7C%7C i%3C0) %7B%0A      currentIndex = 0;  %0A      if (i%3C0) %7B%0A        currentIndex = size()-1;%0A      %7D%0A    %7D else%0A    %7B%0A      currentIndex = i;%0A    %7D%0A    return currentIndex;%0A  %7D%0A%0A  public int currentIndex() %7B%0A    return currentIndex;%0A  %7D%0A%0A  public int size() %7B %0A    return colorGroupList.size();%0A  %7D%0A%0A  public HGroupColorPool add(HColorPool clrPool) %7B%0A    colorGroupList.add(clrPool);%0A    return this;%0A  %7D%0A%0A  public HColorPool getRandomColorPool() %7B%0A    //select a color pool at random%0A    if (size() %3C= 0) %7B%0A      return new HColorPool().add(0);%0A    %7D else %7B%0A      int rndIndex = (int) Math.floor(H.app().random(size()));%0A      currentIndex = setIndex(rndIndex);%0A      return colorGroupList.get(rndIndex);%0A    %7D%0A  %7D%0A%0A  public HColorPool getNextColorPool() %7B%0A    //cycles through all available color pools%0A    if (size() %3C= 0) %7B%0A      return new HColorPool().add(0);%0A    %7D else %7B%0A      currentIndex = setIndex(currentIndex+1);%0A      return colorGroupList.get(currentIndex);%0A    %7D%0A  %7D%0A%0A  public HColorPool getPrevColorPool() %7B%0A    //cycles through all available color pools%0A    if (size() %3C= 0) %7B%0A      return new HColorPool().add(0);%0A    %7D else %7B%0A      currentIndex = setIndex(currentIndex+1);%0A      return colorGroupList.get(currentIndex);%0A    %7D%0A  %7D%0A%0A  public HColorPool getColorPool(int index) %7B%0A    //extract a specific color pool%0A    currentIndex = setIndex(index);%0A    return colorGroupList.get(currentIndex);%0A  %7D%0A%7D%0A

Create HGroupColorPool.java