Companion

object Companion

Functions

Link copied to clipboard
fun makeBlend(mode: BlendMode, dst: Shader?, src: Shader?): Shader
Link copied to clipboard
fun makeColor(color: Int): Shader
fun makeColor(color: Color4f, space: ColorSpace?): Shader
Link copied to clipboard
Link copied to clipboard
fun makeFractalNoise(baseFrequencyX: Float, baseFrequencyY: Float, numOctaves: Int, seed: Float, tileSize: ISize = ISize.makeEmpty()): Shader
Link copied to clipboard
fun makeLinearGradient(p0: Point, p1: Point, gradient: Gradient, localMatrix: Matrix33? = null): Shader

Returns a shader that generates a linear gradient between the two specified points. If the inputs are invalid, this will return nullptr.

fun makeLinearGradient(x0: Float, y0: Float, x1: Float, y1: Float, gradient: Gradient, localMatrix: Matrix33? = null): Shader
Link copied to clipboard
fun makeRadialGradient(center: Point, radius: Float, gradient: Gradient, localMatrix: Matrix33? = null): Shader

Returns a shader that generates a radial gradient given the center and radius.

fun makeRadialGradient(x: Float, y: Float, radius: Float, gradient: Gradient, localMatrix: Matrix33? = null): Shader
Link copied to clipboard
fun makeSweepGradient(center: Point, gradient: Gradient, localMatrix: Matrix33? = null): Shader
fun makeSweepGradient(center: Point, startAngle: Float, endAngle: Float, gradient: Gradient, localMatrix: Matrix33? = null): Shader

Returns a shader that generates a sweep gradient given a center. The shader accepts negative angles and angles larger than 360, draws between 0 and 360 degrees, similar to the CSS conic-gradient semantics. 0 degrees means horizontal positive x axis. The start angle must be less than the end angle, otherwise a null pointer is returned. If color stops do not contain 0 and 1 but are within this range, the respective outer color stop is repeated for 0 and 1. Color stops less than 0 are clamped to 0, and greater than 1 are clamped to 1.

fun makeSweepGradient(x: Float, y: Float, gradient: Gradient, localMatrix: Matrix33? = null): Shader
fun makeSweepGradient(x: Float, y: Float, startAngle: Float, endAngle: Float, gradient: Gradient, localMatrix: Matrix33? = null): Shader
Link copied to clipboard
fun makeTurbulence(baseFrequencyX: Float, baseFrequencyY: Float, numOctaves: Int, seed: Float, tileSize: ISize = ISize.makeEmpty()): Shader
Link copied to clipboard
fun makeTwoPointConicalGradient(start: Point, startRadius: Float, end: Point, endRadius: Float, gradient: Gradient, localMatrix: Matrix33? = null): Shader

Returns a shader that generates a conical gradient given two circles, or returns null if the inputs are invalid. The gradient interprets the two circles according to the following HTML spec. http://dev.w3.org/html5/2dcontext/#dom-context-2d-createradialgradient

fun makeTwoPointConicalGradient(x0: Float, y0: Float, startRadius: Float, x1: Float, y1: Float, endRadius: Float, gradient: Gradient, localMatrix: Matrix33? = null): Shader