code: public void changeAlpha(int alpha) {
          alpha = alpha > 255 ? 255 : alpha < 0 ? 0 : alpha;
  
          Color foreground = getForeground();
          int red = foreground.getRed();
          int green = foreground.getGreen();
          int blue = foreground.getBlue();
  
          Color withAlpha = new Color(red, green, blue, alpha);
          super.setForeground(withAlpha);
      }
docs: Convenience method to applyChanges the alpha value of the current foreground
  Color to the specifice value.
  
  @param alpha value in the range of 0 - 255.