public final class ConicGradient
ImplementsPaint
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.
Constructors
public ConicGradient(int[] colors, float[] positions) |
Methods
public byte getKind() | Returns one of KIND_LINEAR, KIND_RADIAL, KIND_CONIC. |
public float getFromAngleDegrees() | |
public ConicGradient setFromAngleDegrees(float fromAngleDegrees) | |
public float getRelativeCenterX() | |
public ConicGradient setRelativeCenterX(float relativeCenterX) | |
public float getRelativeCenterY() | |
public ConicGradient setRelativeCenterY(float relativeCenterY) | |
public int sampleArgb(int px, int py, int width, int height) | Software-rasterizer hook used by the default port implementation when no native gradient shader is available. |
public ConicGradient copy() | Returns a defensive deep copy. |
Inherited fields
Inherited methods
Constructor details
ConicGradient
public ConicGradient(int[] colors, float[] positions)Method details
getKind
public byte getKind()Returns one of
KIND_LINEAR, KIND_RADIAL, KIND_CONIC.getFromAngleDegrees
public float getFromAngleDegrees()setFromAngleDegrees
public ConicGradient setFromAngleDegrees(float fromAngleDegrees)getRelativeCenterX
public float getRelativeCenterX()setRelativeCenterX
public ConicGradient setRelativeCenterX(float relativeCenterX)getRelativeCenterY
public float getRelativeCenterY()setRelativeCenterY
public ConicGradient setRelativeCenterY(float relativeCenterY)sampleArgb
public int sampleArgb(int px, int py, int width, int height)Software-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 overriding
fillGradient directly do not call this.copy
public ConicGradient copy()Returns a defensive deep copy. Implemented by each concrete subclass
so async-paint queues can capture an immutable snapshot.