# 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.

- ## Field Summary

  ### Fields inherited from class Gradient

  `CYCLE_NONE, CYCLE_REFLECT, CYCLE_REPEAT, KIND_CONIC, KIND_LINEAR, KIND_RADIAL`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConicGradient(int[] colors, float[] positions)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ConicGradient`
  `copy()`
  Returns a defensive deep copy.
  `float`
  `getFromAngleDegrees()`
  `byte`
  `getKind()`
  Returns one of `KIND_LINEAR`, `KIND_RADIAL`, `KIND_CONIC`.
  `float`
  `getRelativeCenterX()`
  `float`
  `getRelativeCenterY()`
  `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.
  `ConicGradient`
  `setFromAngleDegrees(float fromAngleDegrees)`
  `ConicGradient`
  `setRelativeCenterX(float relativeCenterX)`
  `ConicGradient`
  `setRelativeCenterY(float relativeCenterY)`

  ### Methods inherited from class Gradient

  `getCachedRaster, getColors, getCycleMethod, getPositions, invalidateRasterCache, paint, paint, parseCss, sampleStops, setCycleMethod`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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`