Package javafx.scene.paint
Class Stop
java.lang.Object
javafx.scene.paint.Stop
Defines one element of the ramp of colors to use on a gradient.
For more information see
LinearGradient
and
RadialGradient
.
Example:
// object bounding box relative (proportional:true, default)
Stop[] stops = { new Stop(0, Color.WHITE), new Stop(1, Color.BLACK)};
LinearGradient lg = new LinearGradient(0, 0, 1, 0, true, CycleMethod.No_CYCLE, stops);
Rectangle r = new Rectangle();
r.setFill(lg);
- Since:
- JavaFX 2.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.final Color
getColor()
Gets the color of the gradient at this offset.final double
Gets a number ranging from0
to1
that indicates where this gradient stop is placed.int
hashCode()
Returns a hash code for thisStop
object.toString()
Returns a string representation of thisStop
object.
-
Constructor Details
-
Stop
Creates a new instance of Stop.- Parameters:
offset
- Stop's position (ranging from0
to1
color
- Stop's color
-
-
Method Details
-
getOffset
public final double getOffset()Gets a number ranging from0
to1
that indicates where this gradient stop is placed. For linear gradients, theoffset
variable represents a location along the gradient vector. For radial gradients, it represents a percentage distance from the focus point to the edge of the outermost/largest circle.- Returns:
- position of the Stop within the gradient
(ranging from
0
to1
)
-
getColor
Gets the color of the gradient at this offset.- Returns:
- the color of the gradient at this offset
-
normalize
-
normalize
-
equals
Indicates whether some other object is "equal to" this one. -
hashCode
public int hashCode()Returns a hash code for thisStop
object. -
toString
Returns a string representation of thisStop
object.
-