Пример #1
0
  /**
   * Gets a random color for the background elements
   *
   * @return The color
   */
  public int getBackgroundColor() {
    if (colors == null) return -1;

    // Get a color int from the hex color
    int base = Util.hex2Color(colors.get(4));

    // Return a slightly modified color
    return Util.getSimilarColor(base, 0.05f);
  }
Пример #2
0
  /**
   * Gets a random color for a bubble
   *
   * @return The color
   */
  public int getBubbleColor() {
    if (colors == null) return -1;

    // Get the third or fourth color
    int randomColor = new Random().nextInt(2) + 2;
    // Get a color int from the hex color
    int base = Util.hex2Color(colors.get(randomColor));

    // Return a slightly modified color
    return Util.getSimilarColor(base);
  }
Пример #3
0
  /**
   * Gets a random color for a triangle / door / spike
   *
   * @return The color
   */
  public int getTriangleColor() {
    if (colors == null) return -1;

    // Get the first or second color
    int randomColor = new Random().nextInt(2);
    // Get a color int from the hex color
    int base = Util.hex2Color(colors.get(randomColor));

    // Return a slightly modified color
    return Util.getSimilarColor(base);
  }