Shader.GradientType
- class GradientType
If the shader subclass can be represented as a gradient, asAGradient returns the matching GradientType enum (or kNone_GradientType if it cannot).
Also, if info is not null, asAGradient populates info with the relevant (see below) parameters for the gradient. fColorCount is both an input and output parameter. On input, it indicates how many entries in fColors and fColorOffsets can be used, if they are non-NULL. After asAGradient has run, fColorCount indicates how many color-offset pairs there are in the gradient. If there is insufficient space to store all of the color-offset pairs, fColors and fColorOffsets will not be altered. fColorOffsets specifies where on the range of 0 to 1 to transition to the given color. The meaning of fPoint and fRadius is dependant on the type of gradient.
None: info is ignored. Color: fColorOffsets[0] is meaningless.
Linear: fPoint[0] and fPoint[1] are the end-points of the gradient
Radial: fPoint[0] and fRadius[0] are the center and radius
- Conical: fPoint[0] and fRadius[0] are the center and radius of the 1st
circle fPoint[1] and fRadius[1] are the center and radius of the 2nd circle Sweep: fPoint[0] is the center of the sweep.
Members:
kNone_GradientType
kColor_GradientType
kLinear_GradientType
kRadial_GradientType
kSweep_GradientType
kConical_GradientType
kLast_GradientType
Methods
Attributes
Methods
- GradientType.__init__(self: skia.Shader.GradientType, value: int) None
Attributes
- GradientType.kColor_GradientType = <GradientType.kColor_GradientType: 1>
- GradientType.kConical_GradientType = <GradientType.kConical_GradientType: 5>
- GradientType.kLast_GradientType = <GradientType.kConical_GradientType: 5>
- GradientType.kLinear_GradientType = <GradientType.kLinear_GradientType: 2>
- GradientType.kNone_GradientType = <GradientType.kNone_GradientType: 0>
- GradientType.kRadial_GradientType = <GradientType.kRadial_GradientType: 3>
- GradientType.kSweep_GradientType = <GradientType.kSweep_GradientType: 4>
- GradientType.name
- GradientType.value