Package icyllis.modernui.graphics

# Class GradientShader.Builder

java.lang.Object
icyllis.modernui.graphics.GradientShader.Builder

Direct Known Subclasses:
  `AngularGradient.Builder`, `LinearGradient.Builder`, `RadialGradient.Builder`

Enclosing class:
  `GradientShader`

public abstract static class GradientShader.Builder extends Object

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract GradientShader`
  `build()`
  `GradientShader.HueInterpolationMethod`
  `getHueInterpolationMethod()`
  `GradientShader.InterpolationColorSpace`
  `getInterpolationColorSpace()`
  `boolean`
  `isInterpolationInPremul()`
  `GradientShader.Builder`
  `setHueInterpolationMethod(GradientShader.HueInterpolationMethod hueInterpolationMethod)`
  For color functions with a hue angle (LCH, HSL, HWB etc.), this specifies a way to interpolate hue values.
  `GradientShader.Builder`
  `setInterpolationColorSpace(GradientShader.InterpolationColorSpace interpolationColorSpace)`
  Set the color space for interpolation.
  `GradientShader.Builder`
  `setInterpolationInPremul(boolean interpolationInPremul)`
  If false, gradients will interpolate their colors in unpremul space and then premultiply each of the results.

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

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

- ## Constructor Details

  - ### Builder

    public Builder()

- ## Method Details

  - ### isInterpolationInPremul

    public boolean isInterpolationInPremul()
    See Also:
      - `setInterpolationInPremul(boolean)`

  - ### setInterpolationInPremul

    public GradientShader.Builder setInterpolationInPremul(boolean interpolationInPremul)
    If false, gradients will interpolate their colors in unpremul space and then premultiply each of the results. If true, gradients will premultiply their colors first, and then interpolate between them.

    Interpolating colors using the premultiplied representations tends to produce more attractive transitions than the non-premultiplied representations, particularly when transitioning from a fully opaque color to fully transparent.

    The default is true to match CSS requirements.

    Parameters:
      `interpolationInPremul` - whether interpolate colors in premul space

  - ### getInterpolationColorSpace

    @NonNull public GradientShader.InterpolationColorSpace getInterpolationColorSpace()
    See Also:
      - `setInterpolationColorSpace(InterpolationColorSpace)`

  - ### setInterpolationColorSpace

    public GradientShader.Builder setInterpolationColorSpace(@NonNull GradientShader.InterpolationColorSpace interpolationColorSpace)
    Set the color space for interpolation.

    The default is `GradientShader.InterpolationColorSpace.DESTINATION`.

  - ### getHueInterpolationMethod

    @NonNull public GradientShader.HueInterpolationMethod getHueInterpolationMethod()
    See Also:
      - `setHueInterpolationMethod(HueInterpolationMethod)`

  - ### setHueInterpolationMethod

    public GradientShader.Builder setHueInterpolationMethod(@NonNull GradientShader.HueInterpolationMethod hueInterpolationMethod)
    For color functions with a hue angle (LCH, HSL, HWB etc.), this specifies a way to interpolate hue values.

    The default is `GradientShader.HueInterpolationMethod.SHORTER`.

  - ### build

    @NonNull public abstract GradientShader build()