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:
| Modifier and Type | Field and Description |
|---|---|
| private DoubleProperty | brightness
The brightness adjustment value. |
| private DoubleProperty | contrast
The contrast adjustment value. |
| private DoubleProperty | hue
The hue adjustment value. |
| private ObjectProperty | input
The input for this |
| private DoubleProperty | saturation
The saturation adjustment value. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ColorAdjust(double
the hue adjustment value hue, double the saturation adjustment value saturation, double the brightness adjustment value brightness, double the contrast adjustment value contrast)Creates a new instance of ColorAdjust with the specified hue, saturation, brightness, and contrast. |
| Modifier and Type | Method and Description |
|---|---|
| public final DoubleProperty | |
| pack-priv boolean | |
| public final DoubleProperty | |
| pack-priv Effect | |
| pack-priv ColorAdjust | |
| pack-priv BaseBounds | getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor)
Implements abstract javafx. Returns bounds of given node with applied effect. |
| public final double | |
| public final double | |
| public final double | |
| public final Effect | |
| public final double | |
| public final DoubleProperty | |
| public final ObjectProperty | |
| public final DoubleProperty | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| pack-priv void |
| brightness | back to summary |
|---|---|
| private DoubleProperty brightness The brightness adjustment value.
Min: -1.0
Max: +1.0
Default: 0.0
Identity: 0.0
| |
| contrast | back to summary |
|---|---|
| private DoubleProperty contrast The contrast adjustment value.
Min: -1.0
Max: +1.0
Default: 0.0
Identity: 0.0
| |
| hue | back to summary |
|---|---|
| private DoubleProperty hue The hue adjustment value.
Min: -1.0
Max: +1.0
Default: 0.0
Identity: 0.0
| |
| input | back to summary |
|---|---|
| private ObjectProperty<Effect> input The input for this
| |
| saturation | back to summary |
|---|---|
| private DoubleProperty saturation The saturation adjustment value.
Min: -1.0
Max: +1.0
Default: 0.0
Identity: 0.0
| |
| ColorAdjust | back to summary |
|---|---|
| public ColorAdjust() Creates a new instance of ColorAdjust with default parameters. | |
| ColorAdjust | back to summary |
|---|---|
| public ColorAdjust(double hue, double saturation, double brightness, double contrast) Creates a new instance of ColorAdjust with the specified hue, saturation, brightness, and contrast.
| |
| brightnessProperty | back to summary |
|---|---|
| public final DoubleProperty brightnessProperty() | |
| checkChainContains | back to summary |
|---|---|
| pack-priv boolean checkChainContains(Effect e) Implements abstract javafx.
| |
| contrastProperty | back to summary |
|---|---|
| public final DoubleProperty contrastProperty() | |
| copy | back to summary |
|---|---|
| pack-priv Effect copy() Implements abstract javafx.
| |
| createPeer | back to summary |
|---|---|
| pack-priv ColorAdjust createPeer() Implements abstract javafx.
| |
| getBounds | back to summary |
|---|---|
| pack-priv BaseBounds getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor) Implements abstract javafx. Doc from javafx. Returns bounds of given node with applied effect. We *never* pass null in as a bounds. This method will NOT take a null bounds object. The returned value may be the same bounds object passed in, or it may be a new object.
| |
| getBrightness | back to summary |
|---|---|
| public final double getBrightness() | |
| getContrast | back to summary |
|---|---|
| public final double getContrast() | |
| getHue | back to summary |
|---|---|
| public final double getHue() | |
| getInput | back to summary |
|---|---|
| public final Effect getInput() | |
| getSaturation | back to summary |
|---|---|
| public final double getSaturation() | |
| hueProperty | back to summary |
|---|---|
| public final DoubleProperty hueProperty() | |
| inputProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| saturationProperty | back to summary |
|---|---|
| public final DoubleProperty saturationProperty() | |
| setBrightness | back to summary |
|---|---|
| public final void setBrightness(double value) | |
| setContrast | back to summary |
|---|---|
| public final void setContrast(double value) | |
| setHue | back to summary |
|---|---|
| public final void setHue(double value) | |
| setInput | back to summary |
|---|---|
| public final void setInput(Effect value) | |
| setSaturation | back to summary |
|---|---|
| public final void setSaturation(double value) | |
| update | back to summary |
|---|---|
| pack-priv void update() Implements abstract javafx.
| |