code: private void applyPalette(Palette palette, ViewGroup viewGroup){
          int bgColor = getBackgroundColor(palette);
          if (bgColor != -1)
              viewGroup.setBackgroundColor(bgColor);
      }
docs: region Helper Methods