JetBrains / jediterm

Pure Java Terminal Emulator. Works with SSH and PTY.
GNU Lesser General Public License v3.0
675 stars 171 forks source link

How can I set the background color to be transparent? #266

Closed Xiaobaishushu25 closed 1 year ago

Xiaobaishushu25 commented 1 year ago

Thank you for your project! I need to set a background image on the panel, and terminal transparency is required to not obscure the image.I try change the com.jediterm.core.Color:

  public Color(int r, int g, int b) {
    this(r, g, b, 0);
    //this(r, g, b, 255);
  }

but that not enough,JediTermWidget extend JPanel,so i add this in JediTermWidget Constructor,

this.setBackground(new java.awt.Color(232, 178, 178,0));

now the terminal is transparent and the backgroundImage can be displayed normally,but the text seems to be constantly re rendering and getting blurry. In addition, how to set the background color of the selected font? My font is black and the highlighted text is also black, which makes it completely invisible to see what has been selected.

Xiaobaishushu25 commented 1 year ago

This problem has been resolved,just need add this:gfx.clearRect(0, 0, getWidth(), getHeight());