Spec-Zone.ru › OpenJavaFX 17

Class ColorAdjust

java.lang.Object
javafx.scene.effect.Effect
javafx.scene.effect.ColorAdjust
public class ColorAdjust
extends Effect
An effect that allows for per-pixel adjustments of hue, saturation, brightness, and contrast.

Example:


 ColorAdjust colorAdjust = new ColorAdjust();
 colorAdjust.setContrast(0.1);
 colorAdjust.setHue(-0.05);
 colorAdjust.setBrightness(0.1);
 colorAdjust.setSaturation(0.2);

 Image image = new Image("boat.jpg");
 ImageView imageView = new ImageView(image);
 imageView.setFitWidth(200);
 imageView.setPreserveRatio(true);
 imageView.setEffect(colorAdjust);
 

The code above applied on this image:

A photo

produces the following:

The visual effect of ColorAdjust on
 photo

Since:
JavaFX 2.0

Property Summary

Properties
Type Property Description
DoubleProperty brightness
The brightness adjustment value.
DoubleProperty contrast
The contrast adjustment value.
DoubleProperty hue
The hue adjustment value.
ObjectProperty<Effect> input
The input for this Effect.
DoubleProperty saturation
The saturation adjustment value.

Constructor Summary

Constructors
Constructor Description
ColorAdjust()
Creates a new instance of ColorAdjust with default parameters.
ColorAdjust​(double hue, double saturation, double brightness, double contrast)
Creates a new instance of ColorAdjust with the specified hue, saturation, brightness, and contrast.

Method Summary

Modifier and Type Method Description
DoubleProperty brightnessProperty()
The brightness adjustment value.
DoubleProperty contrastProperty()
The contrast adjustment value.
double getBrightness()
Gets the value of the property brightness.
double getContrast()
Gets the value of the property contrast.
double getHue()
Gets the value of the property hue.
Effect getInput()
Gets the value of the property input.
double getSaturation()
Gets the value of the property saturation.
DoubleProperty hueProperty()
The hue adjustment value.
ObjectProperty<Effect> inputProperty()
The input for this Effect.
DoubleProperty saturationProperty()
The saturation adjustment value.
void setBrightness​(double value)
Sets the value of the property brightness.
void setContrast​(double value)
Sets the value of the property contrast.
void setHue​(double value)
Sets the value of the property hue.
void setInput​(Effect value)
Sets the value of the property input.
void setSaturation​(double value)
Sets the value of the property saturation.

Methods declared in class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Property Details

input

public final ObjectProperty<Effect> inputProperty
The input for this Effect. If set to null, or left unspecified, a graphical image of the Node to which the Effect is attached will be used as the input.
Default value:
null
See Also:
getInput(), setInput(Effect)

hue

public final DoubleProperty hueProperty
The hue adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0
See Also:
getHue(), setHue(double)

saturation

public final DoubleProperty saturationProperty
The saturation adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0
See Also:
getSaturation(), setSaturation(double)

brightness

public final DoubleProperty brightnessProperty
The brightness adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0
See Also:
getBrightness(), setBrightness(double)

contrast

public final DoubleProperty contrastProperty
The contrast adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0
See Also:
getContrast(), setContrast(double)

Constructor Details

ColorAdjust

public ColorAdjust()
Creates a new instance of ColorAdjust with default parameters.

ColorAdjust

public ColorAdjust(double hue, double saturation, double brightness, double contrast)
Creates a new instance of ColorAdjust with the specified hue, saturation, brightness, and contrast.
Parameters:
hue - the hue adjustment value
saturation - the saturation adjustment value
brightness - the brightness adjustment value
contrast - the contrast adjustment value
Since:
JavaFX 2.1

Method Details

setInput

public final void setInput(Effect value)
Sets the value of the property input.
Property description:
The input for this Effect. If set to null, or left unspecified, a graphical image of the Node to which the Effect is attached will be used as the input.
Default value:
null

getInput

public final Effect getInput()
Gets the value of the property input.
Property description:
The input for this Effect. If set to null, or left unspecified, a graphical image of the Node to which the Effect is attached will be used as the input.
Default value:
null

inputProperty

public final ObjectProperty<Effect> inputProperty()
The input for this Effect. If set to null, or left unspecified, a graphical image of the Node to which the Effect is attached will be used as the input.
Default value:
null
See Also:
getInput(), setInput(Effect)

setHue

public final void setHue(double value)
Sets the value of the property hue.
Property description:
The hue adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0

getHue

public final double getHue()
Gets the value of the property hue.
Property description:
The hue adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0

hueProperty

public final DoubleProperty hueProperty()
The hue adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0
See Also:
getHue(), setHue(double)

setSaturation

public final void setSaturation(double value)
Sets the value of the property saturation.
Property description:
The saturation adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0

getSaturation

public final double getSaturation()
Gets the value of the property saturation.
Property description:
The saturation adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0

saturationProperty

public final DoubleProperty saturationProperty()
The saturation adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0
See Also:
getSaturation(), setSaturation(double)

setBrightness

public final void setBrightness(double value)
Sets the value of the property brightness.
Property description:
The brightness adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0

getBrightness

public final double getBrightness()
Gets the value of the property brightness.
Property description:
The brightness adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0

brightnessProperty

public final DoubleProperty brightnessProperty()
The brightness adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0
See Also:
getBrightness(), setBrightness(double)

setContrast

public final void setContrast(double value)
Sets the value of the property contrast.
Property description:
The contrast adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0

getContrast

public final double getContrast()
Gets the value of the property contrast.
Property description:
The contrast adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0

contrastProperty

public final DoubleProperty contrastProperty()
The contrast adjustment value.
       Min: -1.0
       Max: +1.0
   Default:  0.0
  Identity:  0.0
 
Default value:
0.0
See Also:
getContrast(), setContrast(double)

© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API