Class ConicGradient

java.lang.Object
com.codename1.ui.Gradient
com.codename1.ui.ConicGradient
All Implemented Interfaces:
Paint

public final class ConicGradient extends Gradient

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

  • Constructor Details

    • ConicGradient

      public ConicGradient(int[] colors, float[] positions)
  • Method Details

    • getKind

      public byte getKind()
      Description copied from class: Gradient
      Returns one of KIND_LINEAR, KIND_RADIAL, KIND_CONIC.
      Specified by:
      getKind in class Gradient
    • 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)
      Description copied from class: Gradient
      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.
      Specified by:
      sampleArgb in class Gradient
    • copy

      public ConicGradient copy()
      Description copied from class: Gradient
      Returns a defensive deep copy. Implemented by each concrete subclass so async-paint queues can capture an immutable snapshot.
      Specified by:
      copy in class Gradient