Why the backgroud color changes when I draw on the canvas?

 override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .gray
        view.insetsLayoutMarginsFromSafeArea = false

        setupCanvasView()
        setupToolPicker()
    }
    
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        
        // 确保画布成为第一响应者以显示工具栏
        canvasView.becomeFirstResponder()
    }
    
    func setupCanvasView() {
        canvasView.frame = view.bounds
        canvasView.delegate = self
        canvasView.insetsLayoutMarginsFromSafeArea = false
        
        // 设置画布属性以支持绘画
        canvasView.alwaysBounceVertical = true
        canvasView.alwaysBounceHorizontal = true
        canvasView.isScrollEnabled = true
        canvasView.showsVerticalScrollIndicator = true
        canvasView.showsHorizontalScrollIndicator = true
        canvasView.contentSize = CGSize(width: 500,height: 500)
        
        // 启用绘画功能
        canvasView.drawingPolicy = .anyInput // 支持手指和 Apple Pencil
        view.addSubview(canvasView)
    }

AS THE CODE ABOVE,WHEN I DRAW ON THE CANVAS,THE BACKGROUND CHANGE ITS COLOR TO WHITE, how to fix it? !

Why the backgroud color changes when I draw on the canvas?
 
 
Q