Example #1
0
  public static List<GradientDrawable> populateHueList() {
    ArrayList<GradientDrawable> list = new ArrayList<>();
    updateDifference();
    float delta = (360f / hueDelta) / 2f;

    for (int i = 0; i < hueDelta; ++i) {
      // TODO check this math
      HSVColor hsvColor =
          new HSVColor(
              ((hueCenter + i * (360 / hueDelta) - delta) % 360 + 360) % 360,
              (hueCenter + i * (360 / hueDelta) + delta) % 360,
              1f,
              1f);

      int[] values = gradientHelper(hsvColor, 1f, 1f);

      list.add(new GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT, values));
    }
    return list;
  }
Example #2
0
 public static void setHueRightByPosition(int position) {
   updateDifference();
   float delta = (360f / hueDelta) / 2f;
   rightHue = (hueCenter + position * (360 / hueDelta) + delta) % 360;
 }
Example #3
0
 public static void setHueLeftByPosition(int position) {
   updateDifference();
   float delta = (360f / hueDelta) / 2f;
   leftHue = ((hueCenter + position * (360 / hueDelta) - delta) % 360 + 360) % 360;
 }