0

I'm writing a JavaFX application and I want to create a 'DarkMode' option. I know how to change the background color of the panes but, for the icons (currently are white), I have thought to 'obscure' them by applying effects to the image, like this:

ImageView node = (iteration method)?
ColorAdjust effect = new ColorAdjust();
effect.setContrast(c);
effect.setHue(h);
effect.setSaturation(s);
node.setEffect( effect );

where c,h and s are values to be determined, to achieve the graying effect. The question is: all the icons belong to a CSS class (MainIcons). Can i iterate over them in any way to avoid applying the effects to every image individually?

I have been googling and found nothing about iterating over a set of controls belonging to the same JavaFX CSS class.

Jose
  • 11
  • 1

0 Answers0