-
public class ColorVisual extends SingleLayerVisual
A solid color visual. Displays a rectangle filled with the given color.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
ColorVisual.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Property<Color>
colorProperty
private Color
color
private final LimitedDoubleProperty
transparencyProperty
private Double
transparency
-
Constructor Summary
Constructors Constructor Description ColorVisual(Integer r, Integer g, Integer b, Integer a)
A solid color visual. ColorVisual(Color color)
-
Method Summary
Modifier and Type Method Description final Property<Color>
getColorProperty()
Property for the displayed Color of this Visual. final Color
getColor()
final Unit
setColor(Color color)
final LimitedDoubleProperty
getTransparencyProperty()
Property for the transparency / alpha channel for this Visual. final Double
getTransparency()
final Unit
setTransparency(Double transparency)
ColorVisual
copy()
Copies this ColorVisual to a new object. -
-
Method Detail
-
getColorProperty
final Property<Color> getColorProperty()
Property for the displayed Color of this Visual. The alpha channel gets multiplied with the transparencyProperty i.e. alpha = 128 (50%) and transparency = 0.5 (50%) leads to 25% visibility / 75% transparency.
-
getTransparencyProperty
final LimitedDoubleProperty getTransparencyProperty()
Property for the transparency / alpha channel for this Visual. Must be set between 0 (full transparent) and 1 (non-transparent / solid). Default: 1.
-
getTransparency
final Double getTransparency()
-
setTransparency
final Unit setTransparency(Double transparency)
-
copy
ColorVisual copy()
Copies this ColorVisual to a new object.
-
-
-
-