Using ColorAdjust

The ColorAdjust effect allows us to change the following properties of any node (usually, it is applied to images):

  • Hue
  • Brightness
  • Contrast
  • Saturation

Refer to the following screenshot:

You can really only see how it works in action, so I advise you to run the following sample and try the corresponding controls:

// chapter8/colors/ColorAdjustDemopublic void start(Stage primaryStage) {    // you can use any local image here, I've just provided web one to simplify project stucture    ImageView iv = new ImageView("https://raw.githubusercontent.com/sgrinev/mastering-javafx-9-10-book/master/resources/sample.jpg"); iv.setFitHeight(240); ...

Get Mastering JavaFX 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.