是否可以将效果应用到整个应用程序以更改其颜色?我想例如应用灰度。
我已经看到了ColorAdjust效果,但是我不确定是否可以将其用于灰度效果。
实际上,这很简单。要将效果应用于整个应用程序,请在根节点上使用setEffect方法。为获得灰度效果,请将ColorAdjust的饱和度设置为值-1
ColorAdjust grayscale = new ColorAdjust();
grayscale.setSaturation(-1);
stage.getScene().getRoot().setEffect(grayscale);
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句