code: public void setLayerOpacity(int alpha, int layer) {
  
          if ((alpha >= 0) && (alpha <= 100) && isAttached()) {
              Element colorbar;
  
              switch (layer) {
                  case COLORBAR_A:
                      colorbar = m_colorA.getElement();
                      break;
                  case COLORBAR_B:
                      colorbar = m_colorB.getElement();
                      break;
                  case COLORBAR_C:
                      colorbar = m_colorC.getElement();
                      break;
                  case COLORBAR_D:
                      colorbar = m_colorD.getElement();
                      break;
                  default:
                      return;
              }
              colorbar.getStyle().setOpacity((1.0 * alpha) / 100);
              CmsTransparencyImpl.setTransparency(colorbar, alpha);
          }
      }
docs: Set overlay's opacity.<p>
  @param alpha An opacity percentage, between 100 (fully opaque) and 0 (invisible).
  @param layer which bar to change opacity for, 1-4