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:
  
 
produces the following:
  
 
- Since:
- JavaFX 2.0
- 
Property SummaryProperties Type Property Description DoublePropertybrightnessThe brightness adjustment value.DoublePropertycontrastThe contrast adjustment value.DoublePropertyhueThe hue adjustment value.ObjectProperty<Effect>inputThe input for thisEffect.DoublePropertysaturationThe saturation adjustment value.
- 
Constructor SummaryConstructors 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 SummaryModifier and Type Method Description DoublePropertybrightnessProperty()The brightness adjustment value.DoublePropertycontrastProperty()The contrast adjustment value.doublegetBrightness()Gets the value of the property brightness.doublegetContrast()Gets the value of the property contrast.doublegetHue()Gets the value of the property hue.EffectgetInput()Gets the value of the property input.doublegetSaturation()Gets the value of the property saturation.DoublePropertyhueProperty()The hue adjustment value.ObjectProperty<Effect>inputProperty()The input for thisEffect.DoublePropertysaturationProperty()The saturation adjustment value.voidsetBrightness(double value)Sets the value of the property brightness.voidsetContrast(double value)Sets the value of the property contrast.voidsetHue(double value)Sets the value of the property hue.voidsetInput(Effect value)Sets the value of the property input.voidsetSaturation(double value)Sets the value of the property saturation.
- 
Property Details- 
inputThe input for thisEffect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.- Default value:
- null
- See Also:
- getInput(),- setInput(Effect)
 
- 
hueThe hue adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0- Default value:
- 0.0
- See Also:
- getHue(),- setHue(double)
 
- 
saturationThe saturation adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0- Default value:
- 0.0
- See Also:
- getSaturation(),- setSaturation(double)
 
- 
brightnessThe brightness adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0- Default value:
- 0.0
- See Also:
- getBrightness(),- setBrightness(double)
 
- 
contrastThe 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- 
ColorAdjustpublic ColorAdjust()Creates a new instance of ColorAdjust with default parameters.
- 
ColorAdjustpublic 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- 
setInputSets the value of the property input.- Property description:
- The input for this Effect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.
- Default value:
- null
 
- 
getInputGets the value of the property input.- Property description:
- The input for this Effect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.
- Default value:
- null
 
- 
inputPropertyThe input for thisEffect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.- Default value:
- null
- See Also:
- getInput(),- setInput(Effect)
 
- 
setHuepublic 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
 
- 
getHuepublic 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
 
- 
huePropertyThe hue adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0- Default value:
- 0.0
- See Also:
- getHue(),- setHue(double)
 
- 
setSaturationpublic 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
 
- 
getSaturationpublic 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
 
- 
saturationPropertyThe saturation adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0- Default value:
- 0.0
- See Also:
- getSaturation(),- setSaturation(double)
 
- 
setBrightnesspublic 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
 
- 
getBrightnesspublic 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
 
- 
brightnessPropertyThe brightness adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0- Default value:
- 0.0
- See Also:
- getBrightness(),- setBrightness(double)
 
- 
setContrastpublic 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
 
- 
getContrastpublic 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
 
- 
contrastPropertyThe contrast adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0- Default value:
- 0.0
- See Also:
- getContrast(),- setContrast(double)
 
 
-