background-color="#00000000"
.footer {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
}
1. filter:Alpha(enabled=bEnabled,style=iStyle,  
2. opacity=iOpacity,finishOpacity=iFinishOpacity,  
3. startX=iPercent,startY=iPercent,  
4. finishX=iPercent,finishY=iPercent);  
5.
.item{
	width:200px;
	height: 200px;
	display: flex;
	justify-content: center;
	align-items: center;
	color:#333;
	border-radius: 50%;
	opacity: 0.5;
	background:#DC143C;    
}
View v = findViewById(R.id.content);//找到你要设透明背景的layout 的id  v.getBackground().setAlpha(100);//0~255透明度值 ,0为完全
<div class="demo">
  <div class="demo1">背景色不透明,文字不透明!</div>
  <div class="demo2">背景色半透明,文字不透明!</div>
  </div>
import matplotlib.pyplot as plt

# 创建一个色条
colors = ['red', 'green', 'blue']
plt.bar(range(len(colors)), [1, 2, 3], color=colors, alpha=0.5)

# 显示图表
plt.show()
import javax.swing.*;
import java.awt.*;

public class TransparentTableExample extends JFrame {
    public TransparentTableExample() {
        // 设置窗口标题
        setTitle("透明表格示例");
        
        // 设置窗口大小
        setSize(400, 300);
        
        // 设置窗口关闭时的操作
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        TransparentTableExample example = new TransparentTableExample();
        
        // 显示窗口
        example.setVisible(true);
    }
}
setWindowFlags(Qt::FramelessWindowHint);
import turtle as t
import time
t.color("red", "yellow") t.speed(10) t.begin_fill()
for _ in range(50):    t.forward(200)    t.left(170) end_fill() time.sleep(1)
1 import java.awt.Color;
 2 import java.awt.Container;
 3 import javax.swing.JComponent;
 4 import javax.swing.JFrame;
 5 import javax.swing.JLabel;
 6 import javax.swing.JPanel;
 7 import javax.swing.JRootPane;
 8 
 9 public class BackGround {
10             //设置窗口
11             JFrame f = new JFrame("panel test");                        
12             //设置按钮
13             JLabel label=new JLabel("ABC");                                  
14     public BackGround(){
15         f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
16         f.setSize(300, 200);
17         label.setBounds(80, 50, 100, 80);               
18         //第四层
19         Container root = (JRootPane) f.getRootPane();    
20         root.setBackground(Color.green);        
21         //第三层
22         Container layer=f.getLayeredPane();
23         layer.setBackground(Color.yellow);        
24         //第二层
25         Container content = (JPanel) f.getContentPane();   
26         content.setBackground(Color.orange);        
27         //第一层
28         JComponent glass=(JComponent) f.getGlassPane();
29         glass.setBackground(Color.red);                     
30         //添加组件
31         content.setLayout(null);
32         content.add(label);
33         f.setVisible(true);
34     }
35     public static void main(String[] args) {
36         new BackGround();
37     }
38 }
int imagecolortransparent ( resource $image [, int $color ] )
import matplotlib.pyplot as plt

# 创建示例数据
x = [1, 2, 3, 4, 5]
y = [2, 4, 6, 8, 10]

# 绘制折线图
plt.plot(x, y)
plt.show()
  • 1
  • 2
  • 3
  • 4
  • 5