Class ConicGradient
java.lang.Object
com.codename1.ui.Gradient
com.codename1.ui.ConicGradient
- All Implemented Interfaces:
Paint
Conic (sweep) gradient. Mirrors CSS conic-gradient([from <angle>] [at <pos>], <stops>).
fromAngleDegrees follows the CSS convention: 0 degrees points up
(toward the top edge), sweep is clockwise.
Conic gradients have no notion of cycle method - the [0,1] stop range always wraps around the circle once.
Since
8.1
-
Field Summary
Fields inherited from class Gradient
CYCLE_NONE, CYCLE_REFLECT, CYCLE_REPEAT, KIND_CONIC, KIND_LINEAR, KIND_RADIAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a defensive deep copy.floatbytegetKind()Returns one ofKIND_LINEAR,KIND_RADIAL,KIND_CONIC.floatfloatintsampleArgb(int px, int py, int width, int height) Software-rasterizer hook used by the default port implementation when no native gradient shader is available.setFromAngleDegrees(float fromAngleDegrees) setRelativeCenterX(float relativeCenterX) setRelativeCenterY(float relativeCenterY) Methods inherited from class Gradient
getColors, getCycleMethod, getPositions, paint, paint, sampleStops, setCycleMethod
-
Constructor Details
-
ConicGradient
public ConicGradient(int[] colors, float[] positions)
-
-
Method Details
-
getKind
-
getFromAngleDegrees
public float getFromAngleDegrees() -
setFromAngleDegrees
-
getRelativeCenterX
public float getRelativeCenterX() -
setRelativeCenterX
-
getRelativeCenterY
public float getRelativeCenterY() -
setRelativeCenterY
-
sampleArgb
public int sampleArgb(int px, int py, int width, int height) Description copied from class:GradientSoftware-rasterizer hook used by the default port implementation when no native gradient shader is available. Samples an ARGB color for the pixel at (px, py) within a rectangle of the given width / height. Ports overridingfillGradientdirectly do not call this.- Specified by:
sampleArgbin classGradient
-
copy
Description copied from class:GradientReturns a defensive deep copy. Implemented by each concrete subclass so async-paint queues can capture an immutable snapshot.
-