import vtkFullScreenRenderWindow from 'vtk.js/Sources/Rendering/Misc/FullScreenRenderWindow';
const fullScreenRenderer = vtkFullScreenRenderWindow.newInstance({ background: [0, 0, 0], }); const renderWindow = fullScreenRenderer.getRenderWindow();
修改背景色如下 fullScreenRenderer.setBackground([255, 255, 255]);
设置完背景颜色后需要重新渲染窗口,否则不生效
renderWindow.render();
若设置值后一直看到白色背景,那是因为把值从0-255变成了0-1的比列取值,因此,如果出现此情况只需要把rgb的每项除于255即可