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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract GradientShader
build()
boolean
setHueInterpolationMethod
(GradientShader.HueInterpolationMethod hueInterpolationMethod) For color functions with a hue angle (LCH, HSL, HWB etc.), this specifies a way to interpolate hue values.setInterpolationColorSpace
(GradientShader.InterpolationColorSpace interpolationColorSpace) Set the color space for interpolation.setInterpolationInPremul
(boolean interpolationInPremul) If false, gradients will interpolate their colors in unpremul space and then premultiply each of the results.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
isInterpolationInPremul
public boolean isInterpolationInPremul()- See Also:
-
setInterpolationInPremul
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
- See Also:
-
setInterpolationColorSpace
public GradientShader.Builder setInterpolationColorSpace(@NonNull GradientShader.InterpolationColorSpace interpolationColorSpace) Set the color space for interpolation.The default is
GradientShader.InterpolationColorSpace.DESTINATION
. -
getHueInterpolationMethod
- See Also:
-
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
-